class DefinedObject(object):
    pass

from StringIO import StringIO

class DefinedObject(object):

    def to_xml(self):
        """Export an object as an XML String"""

        s = StringIO()
        self.to_obj().export(s, 0)
        return s.getvalue()

Add utility method to DefinedObject base class
Add utility method to DefinedObject base class
