As you know XSLT requires well formed document (e.g. closing HTML tag without opening is causing an error).
The problem is that I need to create an closing tag which should be ignored by XSLT.
Since there was no opening tag in that xsl the error appears :-(.
As a merely fact opening tag is placed in some included *.asp page.
It’s not clear from your post if you’re generating the document that will be input to an XSLT processor or if you’re trying to clean up a document you got from someone else. If you’re the one generating the document, then don’t be a bozo and make sure it’s well formed. (Here is some advice about how to do that.) If you’re getting the document from someone else, you might take a look at HTML Tidy or similar programs.