Can Applescript read an XML file stored as a variable?

Thank you!

In theory, yes. AppleScript takes time to recover from errors as there’s an overhead incurred in retrieving error codes and messages, plus other stuff that happens under the hood.