Adds a catch to previous patch to ensure $xml is not returned if
tests fail.