REST/XML instead of JSON


Is there any way to use XData to work with REST/XML instead of REST/JSON?

I suppose I can get away with sending the XML request with:
  Request.SetContent(TEncoding.UTF8.GetBytes(MyXMLDataVar));

But if the response is XML, how would I effectively respond when  something like this is returned :


<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_IF72_ASN_RES xmlns:ns0="xxxx">
<ShipmentID/>
<Status>
<Code>200</Code>
<Text>Succes.</Text>
<ReferenceID>Header</ReferenceID>
</Status>
</ns0:MT_IF72_ASN_RES>



That is, will  StatusCodel be parsed correctly to be able to use


 Response := Client.Send(Request);
    if Response.StatusCode = 200 then



Some of the returned error codes are IID, 11, IQT... (not the standard html error codes)

eg


<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_IF72_ASN_RES xmlns:ns0="xxxx">
<ShipmentID/>
<Status>
<Code>IID</Code>
<Text>Missing shipment ID</Text>
<ReferenceID>Header</ReferenceID>
</Status>
</ns0:MT_IF72_ASN_RES>



TIA,
EdB

The status code should be returned as HTTP status code, regardless if the content is JSON or XML.

If your status code is inside the XML, that's specific format and the client should parse the XML to get the status code in the tag specified by your application (in this case, <Code> tag).