Immunization for disambiguation: empty line affects the disambiguation

I want to make disambiguation rules that immunize XML code. This rule immunizes an XML declaration:

<rule id="IMMUNIZE_XML_DECLARATION" name="Immunize XML declaration">
    <pattern>
        <marker>
            <token regexp="yes">&lt;</token>
            <token>?</token>
            <token>xml</token>
            <token min="0" max="20"/>
            <token>?</token>
            <token regexp="yes">&gt;</token>
        </marker>
    </pattern>
    <disambig action="immunize"/>
</rule>

But, if the lines of XML code are not separated by an empty line, I see this:

I don’t understand why the rule does not work if there is no blank line. Do you have ideas/suggestions?

How can it tell that the code line ends when there are no paragraph breaks? (this could play havoc with the token count)

@SkyCharger001,

Forget about code. The disambiguation rule could be for anything. The disambiguation rule does not have a token for SENT_END. Where the line ends is not part of the rule.

The text in line 1 is immunized. The text in line 4 is not immunized:
image

Is it possible to write a disambiguation rule such that the text in line 4 that is between < and > is immunized, or is code-like text a special case?