def _CreateClassFromElementTree(target_class, tree, namespace=None, tag=None):
 if (namespace is None):
  namespace = target_class._namespace
 if (tag is None):
  tag = target_class._tag
 if (tree.tag == ('{%s}%s' % (namespace, tag))):
  target = target_class()
  target._HarvestElementTree(tree)
  return target
 else:
  return None

def _CreateClassFromElementTree ( target_class , tree , namespace = None , tag = None ) : if ( namespace is None ) : namespace = target_class . _namespace if ( tag is None ) : tag = target_class . _tag if ( tree . tag == ( '{%s}%s' % ( namespace , tag ) ) ) : target = target_class ( ) target . _HarvestElementTree ( tree ) return target else : return None
instantiates the class and populates members according to the tree .