The original present-slots function body

(if slots
    <table
        <thead (:bgcolor "#888888")
               <td <i "name">>
               <td <i "type">>
               <td <i "readers">>
               <td <i "writers">>>
      ,@(loop
           for index :from 0
           for slot :in slots
           collect (present-slot slot index))>
    <span "there are none">)

The present-slots function expands into the following (all AST's may contain lambda's as a means to delay execution, but it's just an implementation detail from the user's point of view):

(if slots
    (lambda ()
      (write-sequence
       #(60 116 97 98 108 101 62 60 116 104 101 97 100 32 98 103 99 111 108 111 114 61 34 35 56 56 56 56 56 56 34 62 60 116 100 62 60 105 62 78 97
         109 101 60 47 105 62 60 47 116 100 62 60 116 100 62 60 105 62 84 121 112 101 60 47 105 62 60 47 116 100 62 60 116 100 62 60 105 62 82 101 97
         100 101 114 115 60 47 105 62 60 47 116 100 62 60 116 100 62 60 105 62 87 114 105 116 101 114 115 60 47 105 62 60 47 116 100 62 60 47 116 104
         101 97 100 62)
       *http-stream*)
      (write-quasi-quoted-binary
       (transform-quasi-quoted-string-to-quasi-quoted-binary
        (map 'list #'transform-quasi-quoted-xml-to-quasi-quoted-string/element
             (loop for index :from 0 for slot :in slots collect (present-slot slot index))))
       *http-stream*)
      (write-sequence #(60 47 116 97 98 108 101 62) *http-stream*)
      (values))
    (lambda ()
      (write-sequence #(60 115 112 97 110 62 84 104 101 114 101 32 97 114 101 32 110 111 110 101 60 47 115 112 97 110 62) *http-stream*)
      (values)))

The original present-class-references function body

(if classes
    <ul
     ,@(mapcar (lambda (class)
                 <li ,(present-class-reference class)>)
               classes)>
    <span "There are none">)

The present-class-references function expands into the following (notice how certain parts are wrapped into lambda's to delay their execution to the required point in runtime):

(if classes
    (lambda ()
      (write-sequence #(60 117 108 62) *http-stream*)
      (write-quasi-quoted-binary
       (transform-quasi-quoted-string-to-quasi-quoted-binary
        (map 'list #'transform-quasi-quoted-xml-to-quasi-quoted-string/element
             (mapcar
              (lambda (class)
                (lambda ()
                  (write-sequence #(60 108 105 62) *http-stream*)
                  (write-quasi-quoted-binary
                   (transform-quasi-quoted-string-to-quasi-quoted-binary
                    (transform-quasi-quoted-xml-to-quasi-quoted-string/element (present-class-reference class)))
                   *http-stream*)
                  (write-sequence #(60 47 108 105 62) *http-stream*)
                  (values)))
              classes)))
       *http-stream*)
      (write-sequence #(60 47 117 108 62) *http-stream*)
      (values))
    (lambda ()
      (write-sequence #(60 115 112 97 110 62 84 104 101 114 101 32 97 114 101 32 110 111 110 101 60 47 115 112 97 110 62) *http-stream*)
      (values)))

Changing the transformation at the top of the file to write strings into the stream instead of binary data

(enable-quasi-quoted-xml-syntax-in-readtable
 :transform '(quasi-quoted-string
              (string-emitting-form :stream *http-stream*)))

With the changed transformation the present-class-references function expands into

(if classes
    (lambda ()
      (write-string "<ul>" *http-stream*)
      (write-quasi-quoted-string
       (map 'list #'transform-quasi-quoted-xml-to-quasi-quoted-string/element
            (mapcar
             (lambda (class)
               (lambda ()
                 (write-string "<li>" *http-stream*)
                 (write-quasi-quoted-string (transform-quasi-quoted-xml-to-quasi-quoted-string/element (present-class-reference class))
                                            *http-stream*)
                 (write-string "</li>" *http-stream*)
                 (values)))
             classes))
       *http-stream*)
      (write-string "</ul>" *http-stream*)
      (values))
    (lambda () (write-string "<span>there are none</span>" *http-stream*) (values)))

Change the transformation at the top of the file to return strings instead of writing binary data to the stream

(enable-quasi-quoted-xml-syntax
 :transform '(quasi-quoted-string
              string-emitting-form))

With the changed transformation the present-class-references function expands into

(if classes
    (make-string-quasi-quote
     (with-string-stream-to-string *string-stream* (write-string "<ul>" *string-stream*)
                                   (write-quasi-quoted-string
                                    (map 'list #'transform-quasi-quoted-xml-to-quasi-quoted-string/element
                                         (mapcar
                                          (lambda (class)
                                            (lambda ()
                                              (write-string "<li>" *string-stream*)
                                              (write-quasi-quoted-string
                                               (transform-quasi-quoted-xml-to-quasi-quoted-string/element (present-class-reference class))
                                               *string-stream*)
                                              (write-string "</li>" *string-stream*)
                                              (values)))
                                          classes))
                                    *string-stream*)
                                   (write-string "</ul>" *string-stream*)))
    (make-string-quasi-quote "<span>there are none</span>"))