Hi,
Refer to "Since you'll first get info about the current XML, you can check prior to checking out if the form is already checked out", do you mean to check if "Checked Out To" is empty? This does not work for forms that are open (somehow locked) but not explicitly checked out by users, though. Do you know of ...