title: JAXB Unmarshalling not working. Expected elements are (none)
body: <p>I am trying to unmarshal an XML.</p>
  
  <p>This is what my XML looks like</p>
  
  <pre><code>&lt;DeviceInventory2Response xmlns="http://tempuri.org/"&gt;
  &lt;DeviceInventory2Result xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt;
    &lt;Obj123 xmlns=""&gt;
       &lt;Id&gt;1&lt;/Id&gt;
       &lt;Name&gt;abc&lt;/Name&gt;
    &lt;/Obj123&gt;
    &lt;Obj456 xmlns=""&gt;
    .
    .
    .
  </code></pre>
  
  <p>I am trying to get Id and Name under Obj123.  However when I run my unmarshal command I get the following error.</p>
  
  <pre><code>An Error:  javax.xml.bind.UnmarshalException: unexpected element (uri:"http://tempuri.org/", local:"DeviceInventory2Response"). Expected elements are (none)
  </code></pre>
  
  <p>My code looks like this in the main class:</p>
  
  <pre><code>Obj123 myObj123 = (Obj123) unmarshaller.unmarshal(inputSource);
  </code></pre>
  
  <p>And my class for Obj123 looks like this:</p>
  
  <pre><code>package com.myProj.pkg;
  
  import javax.xml.bind.annotation.XmlElement;
  import javax.xml.bind.annotation.XmlElementWrapper;
  import javax.xml.bind.annotation.XmlRootElement;
  import javax.xml.bind.annotation.XmlType;
  
  
  @XmlRootElement(name="Obj123")
  public class Obj123 {
  
    private String Id;
    private String Name;
  
    public String getId() {
      return Id;
    }
  
    public String getName() {
      return Name;
    }
  }
  </code></pre>
  
  <p>I thought by setting my XMLRootElement that I should be able to skip the first 2 lines of my XML but that doesn't seem to be happening.  Any ideas?</p>
  
  <p>Edit:</p>
  
  <p>This is how my JAXB Context is made:</p>
  
  <pre><code>JAXBContext jaxbContext = JAXBContext.newInstance();
  Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
  Obj123 obj123 = (Obj123) unmarshaller.unmarshal(xmlStreamReader);
  </code></pre>