def writeXML(self, out):
    '\n        writes table data to file out in xml format\n        '
    import xml.etree.ElementTree as ET
    from xml.sax.saxutils import escape
    root = ET.Element('tdx')
    self._outTest(out)

    def _indent(elem, level=0):
        i = ('\n' + (level * '  '))
        if len(elem):
            if ((not elem.text) or (not elem.text.strip())):
                elem.text = (i + '  ')
            if ((not elem.tail) or (not elem.tail.strip())):
                elem.tail = i
            for elem in elem:
                _indent(elem, (level + 1))
            if ((not elem.tail) or (not elem.tail.strip())):
                elem.tail = i
        elif (level and ((not elem.tail) or (not elem.tail.strip()))):
            elem.tail = i
    for r in range(1, self.nrows()):
        doc = ET.SubElement(root, 'row')
        for c in range(0, self.ncols()):
            cell = self.cell(c, r)
            if (cell or (r == 1)):
                ET.SubElement(doc, self.table[0][c]).text = escape(str(cell))
    tree = ET.ElementTree(root)
    _indent(root)
    tree.write(out, encoding='UTF-8', xml_declaration=True)
    self.verbose(('xml written to %s' % out))
writes table data to file out in xml format
def writeXML(self, out):
    '\n        \n        '
    import xml.etree.ElementTree as ET
    from xml.sax.saxutils import escape
    root = ET.Element('tdx')
    self._outTest(out)

    def _indent(elem, level=0):
        i = ('\n' + (level * '  '))
        if len(elem):
            if ((not elem.text) or (not elem.text.strip())):
                elem.text = (i + '  ')
            if ((not elem.tail) or (not elem.tail.strip())):
                elem.tail = i
            for elem in elem:
                _indent(elem, (level + 1))
            if ((not elem.tail) or (not elem.tail.strip())):
                elem.tail = i
        elif (level and ((not elem.tail) or (not elem.tail.strip()))):
            elem.tail = i
    for r in range(1, self.nrows()):
        doc = ET.SubElement(root, 'row')
        for c in range(0, self.ncols()):
            cell = self.cell(c, r)
            if (cell or (r == 1)):
                ET.SubElement(doc, self.table[0][c]).text = escape(str(cell))
    tree = ET.ElementTree(root)
    _indent(root)
    tree.write(out, encoding='UTF-8', xml_declaration=True)
    self.verbose(('xml written to %s' % out))