When you are finished writing to the file, you are responsible for releasing the parser from memory. This operation is not performed automatically. To release the parser, use the CXML-RELEASE-PARSER op-code. For example:
call "C$XML" using CXML-RELEASE-PARSER parser-handle.