code: def parse(celf, s) :
          "generates an Introspection tree from the given XML string description."
          def from_string_elts(celf, attrs, tree) :
              elts = dict((k, attrs[k]) for k in attrs)
              child_tags = dict \
                (
                  (childclass.tag_name, childclass)
                  for childclass in tuple(celf.tag_elts.values()) + (Introspection.Annotation,)
                )
              children = []
              for child in tree :
                  if child.tag not in child_tags :
                      raise KeyError("unrecognized tag %s" % child.tag)
                  childclass = child_tags[child.tag]
                  childattrs = {}
                  for attrname in childclass.tag_attrs :
                      if hasattr(childclass, "tag_attrs_optional") and attrname in childclass.tag_attrs_optional :
                          childattrs[attrname] = child.attrib.get(attrname, None)
                      else :
                          if attrname not in child.attrib :
                              raise ValueError("missing %s attribute for %s tag" % (attrname, child.tag))
                          childattrs[attrname] = child.attrib[attrname]
                  if hasattr(childclass, "attr_convert") :
                      for attr in childclass.attr_convert :
                          if attr in childattrs :
                              childattrs[attr] = childclass.attr_convert[attr](childattrs[attr])
                  children.append(from_string_elts(childclass, childattrs, child))
              for child_tag, childclass in tuple(celf.tag_elts.items()) + ((), (("annotations", Introspection.Annotation),))[tree.tag != "annotation"] :
                  for child in children :
                      if isinstance(child, childclass) :
                          if child_tag not in elts :
                              elts[child_tag] = []
                          elts[child_tag].append(child)
              return \
                  celf(**elts)
          tree = XMLElementTree.fromstring(s)
          assert tree.tag == "node", "root of introspection tree must be <node> tag"
          return \
              from_string_elts(Introspection, {}, tree)