#lang scheme

(require xml)

(define (create-document head body (pre-comments null) (post-comments null) (tail-comments null))
  (make-document 
   (apply 
	make-prolog 
	(cons (make-p-i #f #f "xml" "version=\"1.0\" encoding=\"UTF-8\"") pre-comments)
    (make-document-type 'html (make-external-dtd/public 
                               "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" 
                               "-//W3C//DTD XHTML 1.0 Strict//EN") #f)
	post-comments)
   (xexpr->xml 
    `(html ((lang "en") (xml:lang "en") (xmlns "http://www.w3.org/1999/xhtml"))
           (head () ,head)
           (body () ,body)))
   tail-comments))

(define (only-comments? l)
  (andmap comment? l))

(provide/contract 
 [create-document 
  (->*
   (xexpr? xexpr?) (only-comments? only-comments? only-comments?) document?)])