def SubTemplateElement(parent, tag, attrib=None, selector=None, subselector=None, **extra):
 attrib = (attrib or {})
 attrib.update(extra)
 elem = TemplateElement(tag, attrib=attrib, selector=selector, subselector=subselector)
 if (parent is not None):
  parent.append(elem)
 return elem

def SubTemplateElement ( parent , tag , attrib = None , selector = None , subselector = None , ** extra ) : attrib = ( attrib or { } ) attrib . update ( extra ) elem = TemplateElement ( tag , attrib = attrib , selector = selector , subselector = subselector ) if ( parent is not None ) : parent . append ( elem ) return elem
create a template element as a child of another .