     toString: =>
       "#{@name} = #{@pattern}"
 
-
-  #** QName - label for elements and attributes
-
-  class QName
-    constructor: (@uri, @localName) ->
-
-  #** XML document classes
-
-  class ChildNode
-
-  class ElementNode extends ChildNode
-    constructor: (@qName, @context, @attributeNodes, @childNodes) ->
-
-  class TextNode extends ChildNode
-    constructor: (@string)
-
-  class AttributeNode
-    constructor: (@qName, @string) ->
-
-  { _getAttr, getPattern, AnyName, Attribute, AttributeNode,
-    ChildNode, Choice, Context, Data, Datatype, Define,
-    Empty,
-    Element, ElementNode, Group, Interleave, List, MissingContent,
+  { _getAttr, getPattern,
+    AnyName, Attribute,
+    Choice, Context,
+    Data, Datatype, Define,
+    Empty, Element,
+    Group,
+    Interleave,
+    List,
+    MissingContent,
     Name, NameClass, NotAllowed, NsName,
-    OneOrMore, Param, Pattern, QName, Ref, Text, TextNode,
-    Value }
+    OneOrMore,
+    Param, Pattern,
+    Ref,
+    Text,
+    Value
+  }

      return node
    if not node
      return new NotAllowed()
    foo = switch node.local
      when 'element' then new Element children[0], children[1]
      when 'define' then new Define _getAttr(node, "name"), children[0]
      when 'notAllowed' then new NotAllowed()

      when 'choice' then new Choice children[0], children[1]
      when 'group' then new Group children[0], children[1]
      when 'interleave' then new Interleave children[0], children[1]
      when "anyName" then new AnyName children[0]
      when "nsName" then new NsName _getAttr(node, "ns"), children[0]
      when "name" then new Name _getAttr(node, "ns"), children[0]
      when "choice" then new Choice children[0], children[1]
      when 'except' then getPattern children[0]
      when 'param' then new Param _getAttr(node, "name"), children[0]
      else
        throw new RNGException("can't parse pattern for #{node.local}")
    pattern


  class RNGException extends Error
