title: Pretty print webservice response on ruby
body: <p>I have to call a webservice but I don't know the format of the response. In any case (xml, json or html) I have to pretty print the response.</p>
  <p>For example, if it is a xml I have to indent and show it properly. Same thing if it is a json. I have two problems here:</p>
  <ol>
  <li>Detecting the format</li>
  <li>Apply a format depending on the type.</li>
  </ol>
  <p>I think that (1) is the most challenging problem.</p>
  <p>Any help?</p>