def to_xml(self, depth=0, indent='  '):
        """Return an XML representation of the document"

        :param depth: the initial indentation offset (depth * indent)
        :param indent: the indent for nested elements.
        """
        offset = indent * depth
        result = offset + '<document>\n'
        result += offset + indent + '<title>\n'
        result += self.title.to_xml(depth=depth + 1)
        result += offset + indent + '</title>\n'
        result += offset + indent + '<sections>\n'
        for s in self.sections:
            result += s.to_xml(depth=depth + 1)
        result += offset + indent + '</sections>\n'
        result += offset + '</document>\n'
        return result