class Nokogiri::XML::Node

def text?

Returns true if this is a Text node
def text?
  type == TEXT_NODE
end