module ActiveSupport::XmlMini_JDOM

def texts(element)

XML element to be checked.
element::

Determines if a document element has text content
def texts(element)
  texts = []
  child_nodes = element.child_nodes
  (0...child_nodes.length).each do |i|
    item = child_nodes.item(i)
    if item.node_type == Node::TEXT_NODE
      texts << item.get_data
    end
  end
  texts
end