private static Resource getContents(XElement content, ErrorList errors) { string contentType = Util.StringValueOrNull(content.Attribute(XATOM_CONTENT_TYPE)); if (contentType != "text/xml") { errors.Add("Entry should have contents of type 'text/xml'"); return(null); } //TODO: This is quite inefficient. The Xml parser has just parsed this //entry's Resource from text, now we are going to serialize it to as string //just to read from it again using a Xml parser. But that is what my //parser takes as input, so no choice for now... return(FhirParser.ParseResourceFromXml(content.FirstNode.ToString(), errors)); }