documentWriter.outputXMLDeclaration(declaration);
}
DocType docType = document.getDocType();
if (docType != null) {
documentWriter.outputDocType(docType);
}
assertEquals("Protocol string should match",
expectedProtocolString,
writer.getBuffer().toString());