Hi José,
I couldn't reproduce the problem. How did you install CXML and CXML-STP? I used the last version from quicklisp running SBCL on a Mac OS:
CL-USER> *features*
(:CL-PPCRE :RUNE-IS-CHARACTER :SWANK :QUICKLISP :ASDF-PACKAGE-SYSTEM :ASDF3.1
:ASDF3 :ASDF2 :ASDF :OS-MACOSX :OS-UNIX :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE
:64-BIT :64-BIT-REGISTERS :ALIEN-CALLBACKS :ANSI-CL :ASH-RIGHT-VOPS :BSD
:C-STACK-IS-CONTROL-STACK :COMMON-LISP :COMPARE-AND-SWAP-VOPS
:COMPLEX-FLOAT-VOPS :CYCLE-COUNTER :DARWIN :DARWIN9-OR-BETTER :FLOAT-EQL-VOPS
:FP-AND-PC-STANDARD-SAVE :GENCGC :IEEE-FLOATING-POINT :INLINE-CONSTANTS
:INODE64 :INTEGER-EQL-VOP :INTERLEAVED-RAW-SLOTS :LINKAGE-TABLE :LITTLE-ENDIAN
:MACH-EXCEPTION-HANDLER :MACH-O :MEMORY-BARRIER-VOPS :MULTIPLY-HIGH-VOPS
:OS-PROVIDES-BLKSIZE-T :OS-PROVIDES-DLADDR :OS-PROVIDES-DLOPEN
:OS-PROVIDES-PUTWC :OS-PROVIDES-SUSECONDS-T :PACKAGE-LOCAL-NICKNAMES
:PRECISE-ARG-COUNT-ERROR :RAW-INSTANCE-INIT-VOPS :SB-CORE-COMPRESSION :SB-DOC
:SB-EVAL :SB-LDB :SB-PACKAGE-LOCKS :SB-SIMD-PACK :SB-SOURCE-LOCATIONS :SB-TEST
:SB-THREAD :SB-UNICODE :SBCL :STACK-ALLOCATABLE-CLOSURES
:STACK-ALLOCATABLE-FIXED-OBJECTS :STACK-ALLOCATABLE-LISTS
:STACK-ALLOCATABLE-VECTORS :STACK-GROWS-DOWNWARD-NOT-UPWARD :SYMBOL-INFO-VOPS
:UD2-BREAKPOINTS :UNIX :UNWIND-TO-FRAME-AND-CALL-VOP :X86-64)
CL-USER> (let ((document (with-open-file (stream (merge-pathnames #P"content.xml")
:direction :input
:element-type '(unsigned-byte 8))
(cxml:parse stream (stp:make-builder)))))
(with-open-file (salida #P"saida.xml" :direction :output :if-exists :supersede)
(stp:serialize document (cxml:make-character-stream-sink salida))))
#<SB-SYS:FD-STREAM for "file /Users/arademaker/Downloads/saida.xml" {10050733C3}>
The saida.xml file is fine.
$ xmllint -noout saida.xml
Best,