title: How to serialize and deserialize the XML in spring boot?
body: <p>I have an XML request and the response of media type TEXT/XML.</p>
  <p>I am trying to serialize and deserialize the request and response in spring boot.</p>
  <p>Request body as follows.</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;soapenv:Envelope xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; 
  xmlns:ws=&quot;http://ws&quot;&gt;
     &lt;soapenv:Header /&gt;
     &lt;soapenv:Body&gt;
        &lt;ws:doKF&gt;
           &lt;parameterIn&gt;&lt;![CDATA[&lt;KFWS&gt;
    &lt;RqUID&gt;0f73a59f-8388-492e-b17d-ba1fb1b1d2fd&lt;/RqUID&gt;
    &lt;ClientApp&gt;A&lt;/ClientApp&gt;
    &lt;SignOn&gt;
      &lt;Username&gt;web&lt;/Username&gt;
      &lt;Password&gt;Web@123&lt;/Password&gt;
    &lt;/SignOn&gt;
    &lt;CaListOfflineRq&gt;
      &lt;CR&gt;123456&lt;/CR&gt;
    &lt;/CaListOfflineRq&gt;
  &lt;/KFWS&gt;]]&gt;&lt;/parameterIn&gt;
        &lt;/ws:doKF&gt;
     &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  <p>The response as follows</p>
  <pre><code>            &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
          &lt;NS1:Envelope xmlns:NS1=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;
             &lt;NS1:Body&gt;
                &lt;NS2:doKFResponse xmlns:NS2=&quot;http://ws&quot;&gt;
                   &lt;NS2:parameterOut&gt;
                      &lt;KFWS&gt;
                         &lt;RqUID&gt;0f73a59f-8388-492e-b17d-ba1fb1b1d2fd&lt;/RqUID&gt;
                         &lt;LogID&gt;48151382-77bc-11eb-8dbc-0a05010a0000&lt;/LogID&gt;
                         &lt;Status&gt;
                            &lt;StatusCode&gt;0&lt;/StatusCode&gt;
                            &lt;StatusDesc&gt;Success&lt;/StatusDesc&gt;
                         &lt;/Status&gt;
                         &lt;CaListOfflineRs&gt;
                            &lt;ReturnCode&gt;0&lt;/ReturnCode&gt;
                            &lt;ReturnDesc&gt;Success&lt;/ReturnDesc&gt;
                            &lt;CaCards&gt;
                               &lt;CaCard&gt;
                                  &lt;CaMasked&gt;490061&lt;/CaMasked&gt;
                                  &lt;CaNoToken&gt;2140&lt;/CaNoToken&gt;
                                  &lt;CaToken&gt;2140&lt;/CaToken&gt;
                                  &lt;Name&gt;xxxxxxxxxxxxxxx&lt;/Name&gt;
                                  &lt;Type&gt;Primary&lt;/Type&gt;
                                  &lt;Class&gt;SMART&lt;/Class&gt;
                                  &lt;Status&gt;Expired&lt;/Status&gt;
                                  &lt;Number&gt;20000&lt;/Number&gt;
                               &lt;/CaCard&gt;
                               &lt;CaCard&gt;
                                  &lt;CaMasked&gt;4904061&lt;/CaMasked&gt;
                                  &lt;CaNoToken&gt;2140&lt;/CaNoToken&gt;
                                  &lt;CaToken&gt;2140&lt;/CaToken&gt;
                                  &lt;Name&gt;xxxxxxxxxxxxxxx&lt;/Name&gt;
                                  &lt;Type&gt;Primary&lt;/Type&gt;
                                  &lt;Class&gt;SMART&lt;/Class&gt;
                                  &lt;Status&gt;Expired&lt;/Status&gt;
                                  &lt;Number&gt;20000&lt;/Number&gt;
                               &lt;/CaCard&gt;
                            &lt;/CaCards&gt;
                         &lt;/CaListOfflineRs&gt;
                      &lt;/KFWS&gt;
                   &lt;/NS2:parameterOut&gt;
                &lt;/NS2:doKFResponse&gt;
             &lt;/NS1:Body&gt;
          &lt;/NS1:Envelope&gt;
  </code></pre>
  <p>I got the response using the Feign client in the string and I need to de-serialise the response to the JSON</p>