# File nqxml/tokenizer.rb, line 897
 def nextEntity
	    entity = nil
	    if @generatedEndTag
		entity = @generatedEndTag
		@generatedEndTag = nil
	    elsif peekMatches?('<')
		entity = nextBracketToken()
	    else
		entity = nextText()
		# nextText() returns nil when a substitution caused a tag
		# to be introduced into the text.
		entity = nextEntity() if entity.nil?
	    end
	    return entity
	end