I will suggest this (not sure if it is most efficient)
a)convert the xmlresponse to xmlnode
b)query the xmlnode for 2 different vars
c)have if…then…else (branch) logic to determine which one is null
d)based on that, convert the xmlnode to document using appropriate schema and use it for further logic
try this approach and let me know if it works.