title: How to convert XML containing code and different namespaces to objects using Java?
body: <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Response xmlns="http://www.demo.com/response/ResponseDetails"    
  xmlns:ft="http://www.demo.com/response/footer" 
  xmlns:hd="http://www.demo.com/response/header"   
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"       
  xsi:schemaLocation="http://www.demo.com/response/ResponseDetails    
  Response.xsd"&gt;
  &lt;hd:header&gt;
    &lt;hd:STATUS&gt;
      &lt;hd:MESSAGE&gt;
        &lt;hd:MESSAGE_CODE&gt;0000&lt;/hd:MESSAGE_CODE&gt;
        &lt;hd:MESSAGE_DESC&gt;SUCCESS&lt;/hd:MESSAGE_DESC&gt;
        &lt;hd:MESSAGE_TYPE&gt;SU&lt;/hd:MESSAGE_TYPE&gt;
      &lt;/hd:MESSAGE&gt;
    &lt;/hd:STATUS&gt;
  &lt;/hd:header&gt;
  &lt;ResponseDetails&gt;
    &lt;TAG1&gt;tag 1 value&lt;/TAG1&gt;
    &lt;TAG2&gt;tag2 value&lt;/TAG2&gt;
    &lt;TAG3&gt;tag3 value&lt;/TAG3&gt;
    &lt;TAG4&gt;tag4 value&lt;/TAG4&gt;
  &lt;/ResponseDetails&gt;
  &lt;ft:footer&gt;
    &lt;ft:CODEDESCRIPTION /&gt;
  &lt;/ft:footer&gt;
  &lt;/Response&gt;
  </code></pre>
  
  <p>This is sample response I get from a web service call and I am unable to convert this string response to object. The above XML is the exact which I receive.
  How can I convert the above XML into objects using either JAXB or xstream?</p>