class Nokogiri::XML::Node

def element?

Returns true if this is an Element node
def element?
  type == ELEMENT_NODE
end