'Generate and parse a document with the given doctype.'

def _document_with_doctype(self, doctype_fragment):

    doctype = ('<!DOCTYPE    %s>' % doctype_fragment)
    markup = (doctype + '\n<p>foo</p>')
    soup = self.soup(markup)
    return (doctype, soup)
