

def _xml(self, root):
    '\n        Return an XML element representing this element\n        '
    element = root.createElement(self.name)
    keys = self.attrs.keys()
    keys.sort()
    for a in keys:
        element.setAttribute(a, self.attrs[a])
    if self.body:
        text = root.createTextNode(self.body)
        element.appendChild(text)
    for c in self.elements:
        element.appendChild(c._xml(root))
    return element

dataset/ETHPy150Open plivo/plivohelper-python/plivohelper.py Element._xml/original