I agree that AwareIM should handle empty XML fields. But since it does not, here is a work around.
First: Change your REST service to dump the complete response into 1 plain text attribute (make sure the attribute is large enough to hold the complete result).
To do this: in the "Reply Details" of your Rest Service, change the "Content type" to text/plain and in "Write into object in Context" enter your BO and attribute that is to hold the response.
Second: Since the BO to hold the response must be in context, either CREATE a new instance of that BO or FIND an existing instance or have the BO be input to your process (which ever way makes more sense in you application) before execution of the REQUEST SERVICE command.
After the REQUEST SERVICE is executed, all of the data is in 1 attribute and can be manipulated anyway you wish.
For example, the following will delete all empty XML fields:
BO.Attribute=REPLACE_PATTERN(REPLACE_PATTERN(BO.Attribute, '<[^<]+?/>', ''), '<(.+?)></\1>', '')
These Regular Expressions will delete empty XML fields in the form of <device_serial /> or <guid></guid>
Once the data is how you want it, perform an IMPORT FROM XML to create the BOs from the XML
like:
IMPORT workstation FROM XML BO.Attribute