 <p>You could solve the problem with the help of <a href="http://www.ruby-doc.org/stdlib-1.9.3/libdoc/rexml/rdoc/REXML/Document.html" rel="nofollow"><code>REXML</code></a> library.</p> <pre><code>require 'rexml/document.rb' doc = REXML::Document.new &lt;&lt;-DOC &lt;Reports&gt; &lt;Report active="1" valid="1" bureau="EXS"&gt; Dummy Dummy&lt;/Report&gt; &lt;/Reports&gt; DOC doc.get_text("/Reports/Report") # =&gt; " Dummy Dummy" </code></pre>