title: XML (with namespace) to Object unmarshalling
body: <p>I got following repsonse from a Web service call, I tried to unmarshal the same using JAXB to map it to a java class. I was getting unmarshal exception while doing so. </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;ns0:QueryByLNResponse xmlns:ns0="UIS_CTMPeople_WS" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
      &lt;ns0:getListValues&gt;
          &lt;ns0:First_Name&gt;Pradeep&lt;/ns0:First_Name&gt;
          &lt;ns0:Internet_E-mail/&gt;
          &lt;ns0:ManagersName/&gt;
          &lt;ns0:Person_ID&gt;PPL1&lt;/ns0:Person_ID&gt;
          &lt;ns0:Last_Name&gt;Srinivasa Reddy&lt;/ns0:Last_Name&gt;
          &lt;ns0:Full_Name&gt;Pradeep M Srinivasa Reddy&lt;/ns0:Full_Name&gt;
      &lt;/ns0:getListValues&gt;
      &lt;ns0:getListValues&gt;
          &lt;ns0:First_Name&gt;Geeth &lt;/ns0:First_Name&gt;
          &lt;ns0:Internet_E-mail&gt;bas@yahoo.com&lt;/ns0:Internet_E-mail&gt;
          &lt;ns0:ManagersName/&gt;
          &lt;ns0:Person_ID&gt;PPL2&lt;/ns0:Person_ID&gt;
          &lt;ns0:Last_Name&gt;Srinivasan&lt;/ns0:Last_Name&gt;
          &lt;ns0:Full_Name&gt;Geeth  Srinivasan&lt;/ns0:Full_Name&gt;
      &lt;/ns0:getListValues&gt;
  &lt;/ns0:QueryByLNResponse&gt;
  </code></pre>
  
  <p>I tried to unmarshal the above code using</p>
  
  <pre class="lang-java prettyprint-override"><code>public static Object xmlToObject(String xml, Class... objClass) throws Exception {
      JAXBContext jc = JAXBContext.newInstance(objClass);
      final Unmarshaller unmarshaller = jc.createUnmarshaller();
      return unmarshaller.unmarshal(new StringReader(xml.toString()));
  }
  </code></pre>
  
  <p>It was throwing following error</p>
  
  <pre><code>javax.xml.bind.UnmarshalException: unexpected element (uri:"UIS_CTMPeople_WS", local:"QueryByLNeResponse"). Expected elements are (none)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(Unknown Source)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportError(Unknown Source)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportError(Unknown Source)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Unknown Source)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childElement(Unknown Source)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(Unknown Source)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(Unknown Source)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.startElement(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(Unknown Source)
  </code></pre>
  
  <p>How can i unmarshalling this using JAXB ( xml to object ).</p>