I have XML file which I want to convert it into the Object. The XML is as follows
<Response>
<result xsi:type="TestResponse">
<description xsi:type="xsd:string">Hello world</description>
<name xsi:type="xsd:string">John</name>
<success xsi:type="xsd:boolean">true</success>
</result>
</Response>
I have tried the approach like
XStream stream = new XStream(new DomDriver());
stream.alias("result", Response.class);
Response response = (Response) stream.fromXML(xmlStr);
It's throwing exception like : `Content is not allowed in prolog`
Response.java is like
public class Response{
private String description;
private String name;
private boolean success;
//setter and getter methods
}