This is a false positive.
parser is not an instance of Document but an instance of the XML parser.
parser
Document