anchor.diff:                (sax:end-document cxml::*sink*))))
         (%enstream stream out-str content))))
   
  -(defmacro %with-snippet ((type &optional stream) &body body)
  +(defmacro %with-snippet ((type &optional stream sink) &body body)
     "helper to define with-html-snippet and with-xhtml-snippet"
     (assert (member type '(with-html-document with-xhtml-document)))
     (alexandria:with-unique-names (out-str)
  
positive.code:   "
    (alexandria:with-unique-names (out-str)
      (let ((content
              `(let ((cxml::*sink* (cxml::make-character-stream-sink ,out-str))
                     (cxml::*current-element* nil)
                     (cxml::*unparse-namespace-bindings* cxml::*initial-namespace-bindings*)
                     (cxml::*current-namespace-bindings* nil))
  
negative.code:       `(let  ((,s-name ,stream)) ,content)
        `(with-output-to-string (,s-name) ,content)))
  
  (defmacro buffer-xml-output ((&optional stream sink) &body body)
    "buffers out sax:events to a sting
  
     xml parameters like <param:foo param:type=\"string\"><div>bar</div></param:foo>
  