title: JAXB nested element Annotation
body: <p>I want to know how to annotate the nested elements in XML using JAXB. </p>
  
  <p>My XML should like this </p>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;feed xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xml:base="http://127.0.0.1:9089/TCMBCommon-iris/TCMBCommon.svc/GB0010001/"&gt;
  &lt;title type="text"&gt;enqTcibAcctDetailss&lt;/title&gt;
  &lt;id&gt;http://127.0.0.1:9089/TCMBCommon-iris/TCMBCommon.svc/GB0010001/enqTcibAcctDetailss()&lt;/id&gt;
  &lt;updated&gt;2016-09-14T10:13:48Z&lt;/updated&gt;
  &lt;link rel="self" title="enqTcibAcctDetailss" href="enqTcibAcctDetailss()" /&gt;
  &lt;entry&gt;
      &lt;id&gt;http://127.0.0.1:9089/TCMBCommon-iris/TCMBCommon.svc/GB0010001/enqTcibAcctDetailss('')&lt;/id&gt;
      &lt;title type="text" /&gt;
      &lt;updated&gt;2016-09-14T10:13:48Z&lt;/updated&gt;
      &lt;author&gt;
          &lt;name /&gt;
      &lt;/author&gt;
      &lt;link rel="self" title="enqTcibAcctDetails" href="enqTcibAcctDetailss('78239')" /&gt;
      &lt;category term="TCMBCommon-modelsModel.enqTcibAcctDetails" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /&gt;
      &lt;content type="application/xml"&gt;
          &lt;m:properties&gt;
              &lt;d:CategoryId&gt;1001&lt;/d:CategoryId&gt;
              &lt;d:Type&gt;Current Account&lt;/d:Type&gt;
              &lt;d:Acc&gt;78239&lt;/d:Acc&gt;
              &lt;d:Ccy&gt;GBP&lt;/d:Ccy&gt;
              &lt;d:OnlineActualBal&gt;330.47&lt;/d:OnlineActualBal&gt;
              &lt;d:RealBalance&gt;330.47&lt;/d:RealBalance&gt;
              &lt;d:Sortcode&gt;601613&lt;/d:Sortcode&gt;
              &lt;d:Customer&gt;100336&lt;/d:Customer&gt;
              &lt;d:ArrangementId&gt;AA16082JD77P&lt;/d:ArrangementId&gt;
              &lt;d:Ac1&gt;78239 Rolf Gerling&lt;/d:Ac1&gt;
              &lt;d:ProductGroup&gt;CURRENT.ACCOUNTS&lt;/d:ProductGroup&gt;
              &lt;d:ProductLine&gt;ACCOUNTS&lt;/d:ProductLine&gt;
              &lt;d:ProductName&gt;CURRENT.ACCOUNT&lt;/d:ProductName&gt;
              &lt;d:AvailAmt&gt;330.47&lt;/d:AvailAmt&gt;
              &lt;d:AvailBalWithLimit&gt;660.94&lt;/d:AvailBalWithLimit&gt;
              &lt;d:IbanId&gt;GB22DEMO60161300078239&lt;/d:IbanId&gt;
              &lt;d:Branch&gt;Model Bank 201608&lt;/d:Branch&gt;
              &lt;d:AcctTransRights&gt;YES&lt;/d:AcctTransRights&gt;
              &lt;d:enqTcibAcctDetails_PortfolioNoMvGroup m:type="Bag(TCMBCommon-modelsModel.enqTcibAcctDetails_PortfolioNoMvGroup)"&gt;
                  &lt;d:element&gt;
                      &lt;d:PortfolioNo&gt;&lt;/d:PortfolioNo&gt;
                  &lt;/d:element&gt;
              &lt;/d:enqTcibAcctDetails_PortfolioNoMvGroup&gt;
              &lt;d:enqTcibAcctDetails_ShortTitleMvGroup m:type="Bag(TCMBCommon-modelsModel.enqTcibAcctDetails_ShortTitleMvGroup)"&gt;
                  &lt;d:element&gt;
                      &lt;d:Name&gt;Rolf Gerling&lt;/d:Name&gt;
                  &lt;/d:element&gt;
              &lt;/d:enqTcibAcctDetails_ShortTitleMvGroup&gt;
              &lt;d:enqTcibAcctDetails_AccountTitle1MvGroup m:type="Bag(TCMBCommon-modelsModel.enqTcibAcctDetails_AccountTitle1MvGroup)"&gt;
                  &lt;d:element&gt;
                      &lt;d:AcctName&gt;Current Account&lt;/d:AcctName&gt;
                  &lt;/d:element&gt;
              &lt;/d:enqTcibAcctDetails_AccountTitle1MvGroup&gt;
          &lt;/m:properties&gt;
      &lt;/content&gt;
  &lt;/entry&gt;
  </code></pre>
  
  <p></p>
  
  <p>I want to get the nested element "Property" directly. But I am not able to achieve.</p>
  
  <p>My POJO class for getting the nested elements"Property" alone is</p>
  
  <pre><code>@XmlRootElement(name="properties", namespace = 
  "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata")
  @XmlAccessorType(XmlAccessType.FIELD)    
  class AccountResource {
  
  @XmlElement(name = "Acc", namespace = 
  "http://schemas.microsoft.com/ado/2007/08/dataservices")
  public String accountNumber;
  
  @XmlElement(name = "AcctName")
  public String accountName;
  
  @XmlElement(name = "Type")
  public String accountType;
  
  @Nullable
  @XmlElement(name = "OnlineActualBal")
  public Float availableBalance;
  
  @Nullable
  @XmlElement(name = "Ccy")
  public String currency;
  
  @Nullable
  @XmlElement(name = "Customer")
  public String customerNumber;
  
  @Nullable
  @XmlElement(name = "AcctTransRights")
  public Boolean transferRights;
  </code></pre>
  
  <p>Kindly Plz help me how to proceed
  1. What is the correct method to annotate the elements using namespace since I am having two or more namespaces.
  2. Do we have to use @XMLElementWrapper for this kind</p>