Ruby's Nokogiri serialize / to_s without whitespace
I have an app that I wish to verify a signature of the xml fragment. Therefore white space is important. Eventually found the way to do this:
xml_object.at_xpath('//Data').serialize(:save_with => Nokogiri::XML::Node::SaveOptions::AS_XML)