+ return None
+
+ def addchild(self, node, child):
+ if child is None:
+ return
+ new = self.nodefrom(child)
+ if new is not None:
+ node.children.append(new)
+ elif isinstance(child, collections.Iterable):
+ for ch in child:
+ self.addchild(node, ch)
+ else:
+ raise Exception("No node conversion known for %s objects" % str(type(child)))
+
+ def addattr(self, node, k, v):
+ if v is not None:
+ node.attrs[str(k)] = str(v)