I am implementing a FHIR Server able to receive Resources on both formats (XML/Json). In order to make it simple an consistent, my idea is to internally work just with XML and to translate Json request to XML and vice versa, but although it works with some sample Json documents, it does not work with FHIR Json resources. The main reason is that FHIR Json resources does not have a "root" element, so the XML conversion tool does not create a proper output XML.
A FHIR Json observation resource is like;
{"resourceType": "Observation","id": "example",...}
And with a root element it should be
{Observation:{"id": "example",...}}
I am aware it's not mandatory for a Json document to have a root element, but ¿if most XML<->Json converters work better in that scenario and FHIR accepts both formats, why not defining FHIR Json resources with a root element? specially when it seem that some initial DSTU used that approach.
Thanks