I would need to remove anything between XML tags, especially whitespace and newlines.
For example removing whitespace and newslines from: \\n<
A solution is to select all "blank" text nodes and remove them.
doc = Nokogiri(xml_source) doc.xpath('//text()[not(normalize-space())]').remove