def __init__(self, doctype=None, strip_whitespace=True, namespace_prefixes=None, drop_xml_decl=True, cache=True):
    super(XHTMLSerializer, self).__init__(doctype, False)
    self.filters = [EmptyTagFilter()]
    if strip_whitespace:
        self.filters.append(WhitespaceFilter(self._PRESERVE_SPACE))
    namespace_prefixes = (namespace_prefixes or {})
    namespace_prefixes['http://www.w3.org/1999/xhtml'] = ''
    self.filters.append(NamespaceFlattener(prefixes=namespace_prefixes, cache=cache))
    if doctype:
        self.filters.append(DocTypeInserter(doctype))
    self.drop_xml_decl = drop_xml_decl
    self.cache = cache
def __init__(self, doctype=None, strip_whitespace=True, namespace_prefixes=None, drop_xml_decl=True, cache=True):
    super(XHTMLSerializer, self).__init__(doctype, False)
    self.filters = [EmptyTagFilter()]
    if strip_whitespace:
        self.filters.append(WhitespaceFilter(self._PRESERVE_SPACE))
    namespace_prefixes = (namespace_prefixes or {})
    namespace_prefixes['http://www.w3.org/1999/xhtml'] = 
    self.filters.append(NamespaceFlattener(prefixes=namespace_prefixes, cache=cache))
    if doctype:
        self.filters.append(DocTypeInserter(doctype))
    self.drop_xml_decl = drop_xml_decl
    self.cache = cache