'Get a string representation of this XML fragment.
@return: A I{plain} string.
@rtype: basestring'

def plain(self):

    result = []
    result.append(('<%s' % self.qname()))
    result.append(self.nsdeclarations())
    for a in [unicode(a) for a in self.attributes]:
        result.append(('    %s' % a))
    if self.isempty():
        result.append('/>')
        return ''.join(result)
    result.append('>')
    if self.hasText():
        result.append(self.text.escape())
    for c in self.children:
        result.append(c.plain())
    result.append(('</%s>' % self.qname()))
    result = ''.join(result)
    return result
