title: How to map XML to JAVA model in android
body: <p>I'm developing an android app and I have some data in XML format from HttpResponce. I want to map that data into Java model. is there any common way that takes Java object and XML data and converts the XML data into Java model. Because I need to write the parsing code every time when I got the XML for different web service. </p>
  
  <p>The following code used for Java, is there any code for Android?</p>
  
  <pre><code>File file = new File("question.xml");  
  JAXBContext jaxbContext = JAXBContext.newInstance(Question.class);  
  
  Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();  
  Question que= (Question) jaxbUnmarshaller.unmarshal(file);  
  
  System.out.println(que.getId()+" "+que.getQuestionname());  
  System.out.println("Answers:");  
  List&lt;Answer&gt; list=que.getAnswers();  
  for(Answer ans:list)  
     System.out.println(ans.getId()+" "+ans.getAnswername()+"  "+ans.getPostedby());  
  </code></pre>