anchor.diff:      (unless (xml-whitespace? (elt s i))
         (return n))))
   
  -
   ;;; Read functions.
   
   (defun xml-read-char (in)
     (when (end-of-file in)
       (xml-error-unexpected-eof in))
  -  (read-char in))
  +  (let c (read-char in)
  +	(push! c *xml2lmlr-read*)
  +	c))
   
   (defun xml-peek-char (in)
     (when (end-of-file in)
  
positive.code:     (or (href s *xml-unified-strings*)
          (setf (href s *xml-unified-strings*) s))))
  
  (defun xml-parse-unify-identifier (in)
    (let i (string-upcase (xml-parse-identifier in))
      (xml-unify-string i)))
  
  (defun xml-parse-text (in)
    "Read plain text until next tag or end of stream."
    (xml-skip-spaces in)
    (xml-read-while in #'xml-text-char?))
  
  (defun xml-parse-name (in)
    "Parse name with optional namespace."
    (with (ident (xml-parse-unify-identifier in))
      (if (= (xml-peek-char in) #\:)
          (progn
  	      (xml-read-char in)
  	      (values ident (xml-parse-unify-identifier in)))
          (values nil (make-symbol ident *keyword-package*)))))
  
  (defun xml-parse-quoted-string-r (in quot)
    (with (c (xml-read-char in))
      (unless (= quot c)
        (cons (if (= c #\\)
  			    (xml-read-char in)
          	    c)
  		    (xml-parse-quoted-string-r in quot)))))
  
  (defun xml-parse-quoted-string (in)
    "Read quoted string."
    (xml-skip-spaces in)
    (with (c (xml-read-char in))
      (unless (or (= c #\") (= c #\'))
        (xml-error "quote expected"))
  	(list-string (xml-parse-quoted-string-r in c))))
  
  (defun xml-parse-attributes (in)
    "Read single attribute assigment."
    (xml-skip-spaces in)
    (when (xml-identifier-char? (xml-peek-char in))
      (with ((ns name) (xml-parse-name in))
        (xml-expect-char in #\=)
        `(,name ,(xml-unify-string (xml-parse-quoted-string in))
  		,@(xml-parse-attributes in)))))
  
  (defun xml-parse-standard-tag (in)
    (with (closing   (xml-read-optional-slash in)
           (ns name) (xml-parse-name in)
           attrs     (xml-parse-attributes in)
           inline    (xml-read-optional-slash in))
      (when (and inline closing)
        (xml-error "/ at start and end of tag")) ; XXX xml-collect-error
  
negative.code: 			  			'opening)
  			attrs)))
  
  (defun xml2lml-version-tag (in)
    (xml-expect-char in #\?)
    (while (not (and (= #\? (xml-read-char in))
  				   (= #\> (xml-read-char in))))
  		 (progn
  		   (xml-expect-char in #\>)
  		   (xml2lml-toplevel in))))
  
  (defun xml-skip-decl (in)
    (while (not (= #\> (xml-read-char in)))
  		 (xml2lml-toplevel in)))
  
  (defun xml-skip-comment (in)
    (while (not (and (= #\- (xml-read-char in))
  				   (= #\- (xml-read-char in))
  				   (= #\> (xml-read-char in))))
  		 (xml2lml-toplevel in)))
  
  (defun xml2lml-comment-or-decl (in)
    (xml-expect-char in #\!)
    (if (and (= #\- (read-char in))
    		   (= #\- (read-char in)))
  	  (xml-skip-comment in)
  	  (xml-skip-decl in)))
  
  (defun xml2lml-tag (in)
    "Read tag and return xml-node."
    (xml-skip-spaces in)
    (xml-expect-char in #\<)
    (xml2lml-standard-tag in))
  
  (defun xml2lml-list (in this-ns this-name)
    "Parse block tag (until it's closed) or inline tag."
    (xml-skip-spaces in)
    (if (= (xml-peek-char in) #\<)
        (with ((ns name type attrs) (xml2lml-tag in))
  	    (case type
  	      ('inline
  	  	       `((,name ,@attrs) ,@(xml2lml-list in this-ns this-name)))
  	      ('closing
  	           (unless (and (string= ns this-ns)
  				            (string= name this-name))
                   (xml-error "closing tag for ~A:~A where ~A:~A was expected"
  			                ns name this-ns this-name)))
  	      (t
  		       `(,(xml2lml-block in ns name attrs) ,@(xml2lml-list in this-ns this-name)))))
  	  `(,(xml2lml-text in) ,@(xml2lml-list in this-ns this-name))))
  
  (defun xml2lml-block (in ns name attrs)
    "Parse block tag (until it's closed) or inline tag."
    `(,name ,@attrs ,@(xml2lml-list in ns name)))
  
  (defun xml2lml-cont-std (in)
    (xml-skip-spaces in)
    (with ((ns name type attrs) (xml2lml-standard-tag in))
  	(unless (eq type 'opening)
  	  (xml-error "Opening tag expected instead of ~A." type))
  	(xml2lml-block in ns name attrs)))
  
  (defun xml2lml-toplevel (in)
    "Parse top-level block tag."
    (xml-skip-spaces in)
    (unless (= #\< (xml-read-char in))
  	(error "expected tag instead of text"))
    (if
  	(= #\? (xml-peek-char in))
  	  (xml2lml-version-tag in)
  	(= #\! (xml-peek-char in))
  	  (xml2lml-comment-or-decl in)
      (xml2lml-cont-std in)))
  
  ;;; Top-level
   
  (defun xml2lml (in)
    (xml-init-tables)
    (xml2lml-toplevel in))
  
  (defun xml2lml-file (name)
    (with-open-file in (open name :direction input)
      (xml2lml in)))
  