http://www.perlmonks.org?node_id=1212565


in reply to Parsing and manipulating XML

Maybe using the no_blanks => 1 option when constructing your parser already is enough? This will make libxml not parse the (considered significant by XML) whitespace between nodes.