matches?(string) -> bool[permalink][rdoc]string が実体宣言の文法に従う文字列であれば真を返します。
require 'rexml/document'
p REXML::Entity.matches?('<!ENTITY s "seal">') # => true
p REXML::Entity.matches?('<!ENTITY % s "seal">') # => true
p REXML::Entity.matches?('<!ELEMENT br EMPTY >') # => false