The matching behavior of a dot can be controlled with a flag. It looks like in Java the default matching behavior for the dot is any character except the line terminators \r and \n.
I'm not a Java programmer, but usually using (?s)
at beginning of a search string changes the matching behavior for a dot to any character including line terminators. So perhaps "(?s)<?xml.*<rss.*</rss>"
works.
But better would be here to use "<?xml.*?<rss[\s\S]*?</rss>"
as search string.
\s
matches any whitespace character which includes line terminators and \S
matches any non whitespace character. Both in square brackets results in matching any character.
For completness: [\w\W]
matches also always any character.