'Indents the tree to make a pretty view of it.'

def indent(self, 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:
            self.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
