I'm designing a WCF web service method that can return results either as a raw XML string, or as a structure, depending on the client's preference.
A simple approach is to have two separate methods:
MyStructure GetData(); string GetDataAsXML();
This should work fine, but given that the wire representation in both cases will be the same (or at least equivalent), I'm wondering if there's a better way to represent this in the interface? Is there an elegant way I can merge the two methods into one, for example?