title: Convert xml string to Java object
body: <p>I have the following xml string. I want to convert it in to a java object, to map each tag with the fields of that object. Its better that if I can introduce different field names compared to tag name. How I can do that? I am looking on JAXB but I am still confused about parts like "ns4:response" and tags within tags. Thank you in advance...</p>
  
  <pre><code>&lt;ns4:response&gt;
      &lt;count&gt;1&lt;/count&gt;
      &lt;limit&gt;1&lt;/limit&gt;
      &lt;offset&gt;1&lt;/offset&gt;
      &lt;ns3:payload xsi:type="productsPayload"&gt;
          &lt;products&gt;
              &lt;product&gt;
                  &lt;avgRating xsi:nil="true"/&gt;
                  &lt;brand&gt;Candie's&lt;/brand&gt;
                  &lt;description&gt;
                      &lt;longDescription&gt;
                      long descriptions
                      &lt;/longDescription&gt;
                      &lt;shortDescription&gt;
                      short description
                      &lt;/shortDescription&gt;
                  &lt;/description&gt;
                  &lt;images&gt;
                      &lt;image&gt;
                          &lt;altText&gt;alternate text&lt;/altText&gt;
                          &lt;height&gt;180.0&lt;/height&gt;
                          &lt;url&gt;
                          url
                          &lt;/url&gt;
                          &lt;width&gt;180.0&lt;/width&gt;
                      &lt;/image&gt;
                  &lt;/images&gt;
                  &lt;price&gt;
                      &lt;clearancePrice xsi:nil="true"/&gt;
                      &lt;regularPrice xsi:nil="true"/&gt;
                      &lt;salePrice&gt;28.0&lt;/salePrice&gt;
                  &lt;/price&gt;
              &lt;/product&gt;
          &lt;/products&gt;
      &lt;/ns3:payload&gt;
  &lt;/ns4:response&gt;
  </code></pre>