I have some parsed Nokogiri::XML::Document objects that I want to print as JSON.
Nokogiri::XML::Document
I can go the route of making it a string, parsing it into a hash, with
If you are trying to convert a SOAP request to REST, this one works too:
require 'active_support/core_ext/hash' require 'nokogiri' xml_string = "b" doc = Nokogiri::XML(xml_string) Hash.from_xml(doc.to_s)