title: JAXBElement.getValue() is returning null
body: <p>I have one to many mapping in my Pojo classes.
  A shop has a branch and a branch has many shops
  Here's Shop's Code:</p>
  
  <pre><code>@XmlAccessorType(XmlAccessType.FIELD)
  @XmlRootElement(name="Shop")
  public class Shop {
  
  @XmlID
  private String name;
  @XmlIDREF
  @XmlElement(name="ShopBranch",type=Branch.class)
  private Branch branch;
  //Getter Setter
  }
  </code></pre>
  
  <p>Below is Branch Code:   </p>
  
  <pre><code> @XmlAccessorType(XmlAccessType.FIELD)
  public class Branch {
  @XmlID
  private String name;
  private String address;
  @XmlIDREF
  @XmlElement(nillable=false,required=true)
  private List&lt;Shop&gt; shops;
  //Getter and Setters
  }
  </code></pre>
  
  <p>I'm publishing a webservice with some basic methods. and my wsimport is generating Branch class as below</p>
  
  <pre><code>@XmlAccessorType(XmlAccessType.FIELD)
  @XmlType(name = "branch", propOrder = {
      "branchName",
      "address",
      "branchShop"
  })
  public class Branch {
  
      @XmlElement(name = "BranchName")
      @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
      @XmlID
      @XmlSchemaType(name = "ID")
      protected String branchName;
      protected String address;
      @XmlElementRef(name = "BranchShop", type = JAXBElement.class)
      protected List&lt;JAXBElement&lt;Object&gt;&gt; branchShop;
      //Getter-Setter
      }
  </code></pre>
  
  <p>I have no idea why it is List&lt;JAXBElement&lt;Object&gt;&gt; and not List&lt;JAXBElement&lt;Shop&gt;&gt;. But anyway. I have a method which returns all branches and that is working fine. When i extract branchShop from branch's instance i'm getting correct size for branchShop list but for all of the items in list getValue is returning NULL.
  Below is brief code:</p>
  
  <pre><code>PencilCatalog service= new PencilCatalog();
  com.pencilhouse.webservices.PencilService port=service.getPencilCatalogPort();
  ((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, Constant.PENCIL_SERVICE);
      List&lt;Branch&gt; branches= port.getAllBranches();
  for(Branch b:branches)
  {
      System.out.println("******************Branch:"+b.getBranchName()+" "+b.getAddress()+"******************");
      JAXBElement&lt;Object&gt;o=b.getBranchShop().get(0);
      System.out.println(o+"Value"+o.getScope()+" "+o.getValue());
  }
  </code></pre>
  
  <p>o/p</p>
  
  <blockquote>
    <p>******************Branch:KukatPalli Steer 2 Kukatpalli******************
    javax.xml.bind.JAXBElement@45d9d7beValueclass
    com.pencilhouse.webservices.Branch null</p>
  </blockquote>
  
  <p>The WSDL generated is quite large. I'm posting only type of Branch and Shop. I'm publishing webservice using Endpoint</p>
  
  <p>XML generated:</p>
  
  <pre><code>&lt;xs:complexType name="shop"&gt;
  &lt;xs:sequence&gt;
  &lt;xs:element name="name" type="xs:ID" minOccurs="0"/&gt;
  &lt;xs:element name="ShopBranch" type="xs:IDREF" minOccurs="0"/&gt;
  &lt;/xs:sequence&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:complexType name="branch"&gt;
  &lt;xs:sequence&gt;
  &lt;xs:element name="BranchName" type="xs:ID" minOccurs="0"/&gt;
  &lt;xs:element name="address" type="xs:string" minOccurs="0"/&gt;
  &lt;xs:element name="BranchShop" type="xs:IDREF" minOccurs="0" maxOccurs="unbounded"/&gt;
  &lt;/xs:sequence&gt;
  &lt;/xs:complexType&gt;
  </code></pre>
  
  <p>Intercepted Information:
  Request:</p>
  
  <pre><code>&lt;S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"&gt;
  &lt;S:Body&gt;
  &lt;ns2:getAllBranches xmlns:ns2="PencilServiceHouse"/&gt;
  &lt;/S:Body&gt;
  &lt;/S:Envelope&gt;
  </code></pre>
  
  <p>Response:</p>
  
  <pre><code>&lt;?xml version="1.0" ?&gt;
  &lt;S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;S:Body&gt;
          &lt;ns2:getAllBranchesResponse xmlns:ns2="PencilServiceHouse"&gt;
          &lt;return&gt;
              &lt;name&gt;
                      KukatPalli
              &lt;/name&gt;
              &lt;address&gt;
                      Steer 2 Kukatpalli
              &lt;/address&gt;
              &lt;shops&gt;
                      Pencil World    &lt;!-- This is Shop Information which is coming as NULL in java, This is Shop's Name field which is declared as id using @XmlId --&gt;
              &lt;/shops&gt;
              &lt;shops&gt;
                      Pencils Den
              &lt;/shops&gt;
              &lt;shops&gt;
                      Pencils Bag
              &lt;/shops&gt;
          &lt;/return&gt;
          &lt;return&gt;
              &lt;name&gt;
                      Salt Lake
              &lt;/name&gt;
              &lt;address&gt;
                      Sec V Salt Lake
              &lt;/address&gt;
              &lt;shops&gt;
                      Pencil World
              &lt;/shops&gt;
              &lt;shops&gt;
                      Pencils Den
              &lt;/shops&gt;
          &lt;/return&gt;
          &lt;return&gt;
              &lt;name&gt;
                      Noida
              &lt;/name&gt;
              &lt;address&gt;
                      Noida Sec 43
              &lt;/address&gt;
              &lt;shops&gt;
                      Pencils Bag
              &lt;/shops&gt;
          &lt;/return&gt;
          &lt;/ns2:getAllBranchesResponse&gt;
      &lt;/S:Body&gt;
  &lt;/S:Envelope&gt;
  </code></pre>