pyobj -- xml.dom.Node.ELEMENT_NODE

def cb(self, elt, sw, pyobj, unsuppressedPrefixes=[]):
        """pyobj -- xml.dom.Node.ELEMENT_NODE
        """
        #if sw.Known(pyobj): 
        #    return

        if type(pyobj) in _stringtypes:
            elt.createAppendTextNode(pyobj)
            return

        ## grab document and import node, and append it
        doc = elt.getDocument()
        node = doc.importNode(pyobj, deep=1)
        child = elt.node.appendChild(node)

        ## copy xmlns: attributes into appended node
        parent = pyobj.parentNode
        while parent.nodeType == _Node.ELEMENT_NODE:
            for attr in filter(lambda a: a.name.startswith('xmlns:') and a.name not in child.attributes.keys(), parent.attributes): 
                child.setAttributeNode(attr.cloneNode(1))

            parent = parent.parentNode