in reply to What is the best way to get the response payload

Assuming your reading from a file handle or something..
while(<RESPONSE>){last if /^<?xml/} while(<RESPONSE>) { #all the lines read here will be the xml document. }