, XML - , cdata. , , nokogiri, :
require 'nokogiri'
xml = Nokogiri::XML.parse "<body><![CDATA[<p>This is a title<br />A subheading</p>]]></body>"
text = Nokogiri::XML.parse("<e>#{xml.text}</e>").text
#=> text = "<p>This is a title<br />A subheading</p>"
, drupal escape- xml, . ? . :
xml.text
xml.text.gsub(/\&\#([0-9]+);/) { |i| $1.to_i.chr }
, !