def add(self, *args):
for obj in args:<EOL><INDENT>if isinstance(obj, numbers.Number):<EOL><INDENT>obj = str(obj)<EOL><DEDENT>if isinstance(obj, basestring):<EOL><INDENT>obj = escape(obj)<EOL>self.children.append(obj)<EOL><DEDENT>elif isinstance(obj, dom_tag):<EOL><INDENT>ctx = dom_tag._with_contexts[_get_thread_context()]<EOL>if ctx and ctx[-<NUM_LIT:1>]:<EOL><INDENT>ctx[-<NUM_LIT:1>].used.add(obj)<EOL><DEDENT>self.children.append(obj)<EOL>obj.parent = self<EOL>obj.setdocument(self.document)<EOL><DEDENT>elif isinstance(obj, dict):<EOL><INDENT>for attr, value in obj.items():<EOL><INDENT>self.set_attribute(*dom_tag.clean_pair(attr, value))<EOL><DEDENT><DEDENT>elif hasattr(obj, '<STR_LIT>'):<EOL><INDENT>for subobj in obj:<EOL><INDENT>self.add(subobj)<EOL><DEDENT><DEDENT>else:  <EOL><INDENT>raise ValueError('<STR_LIT>' % obj)<EOL><DEDENT><DEDENT>if len(args) == <NUM_LIT:1>:<EOL><INDENT>return args[<NUM_LIT:0>]<EOL><DEDENT>return args<EOL>
Add new child tags.