public Leaf makeElement(
     NameClass nameClass, Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations)
     throws BuildException {
   Leaf r = null;
   for (QName n : nameClass.listNames()) {
     Leaf l = new Element(locator, n, leaf);
     if (r != null) r = r.merge(l);
     else r = l;
   }
   if (r == null) return new Empty(locator);
   return r;
 }
 public Leaf makeMixed(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations)
     throws BuildException {
   return leaf.merge(new Data(locator, string));
 }
 public Leaf makeOptional(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations)
     throws BuildException {
   return leaf.merge(new Empty(locator));
 }