def parse_and_validate_response(body, options = {})
        dom = REXML::Document.new(body)

        if (value = options[:root_name]) && dom.root.name != value
          raise ResponseError, "Invalid response, root node is not `#{value}`"
        end
        if (value = options[:root_text]) && dom.root.text != value
          raise ResponseError, value
        end

        dom
      end
def parse_and_validate_response(body, options = {})
        dom = REXML::Document.new(body)

        if (value = options[:root_name]) && dom.root.name != value
          raise ResponseError, "Invalid response, root node is not `#{value}`"
        end
        if (value = options[:root_text]) && dom.root.text != value
          raise ResponseError, value
        end

        dom
      end
Parses the response <tt>body</tt> and runs a common set of validators.
 Returns <tt>body</tt> as parsed REXML::Document on success.

 Raises::  WWW::Delicious::ResponseError in case of invalid response.