GET request fails with "Root element is missing"

I have an API data page that can be called as both GET and PUT. There is a parameter mapping to the request body with an InputValidationRule set for the PUT request. After upgrade from 2022.4 to 2024.6 the GET request fails on the rule evaluation.

2024-07-08 19:23:38,937 [7] ERROR Origam.Server.Pages.UserApiProcessor - Error occured (System.Exception) for request: 
                        //api/PersonalData: Rule evaluation failed. Rule: 'PersonalData_ValidateBody'
System.Exception: Rule evaluation failed. Rule: 'PersonalData_ValidateBody'
 ---> System.Exception: Root element is missing.
 ---> System.Exception: Transformation result invalid.
 ---> System.Xml.XmlException: Root element is missing.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
   at System.Xml.XmlDocument.Load(XmlReader reader)
   at Origam.Service.Core.XmlContainer.Load(XmlReader xmlReader, Boolean doProcessing)
   at Origam.Rule.Xslt.CompiledXsltEngine.Transform(Object engine, XsltArgumentList xslArg, XPathDocument sourceXpathDoc, IXmlContainer resultDoc) in D:\a\1\s\backend\Origam.Rule\Xslt\CompiledXsltEngine.cs:line 79
   at Origam.Rule.Xslt.MicrosoftXsltEngine.Transform(IXmlContainer data, Object xsltEngine, Hashtable parameters, String transactionId, IDataStructure outputStructure, Boolean validateOnly) in D:\a\1\s\backend\Origam.Rule\Xslt\MicrosoftXsltEngine.cs:line 200
   --- End of inner exception stack trace ---
   at Origam.Rule.Xslt.MicrosoftXsltEngine.Transform(IXmlContainer data, Object xsltEngine, Hashtable parameters, String transactionId, IDataStructure outputStructure, Boolean validateOnly) in D:\a\1\s\backend\Origam.Rule\Xslt\MicrosoftXsltEngine.cs:line 233
   --- End of inner exception stack trace ---
   at Origam.Rule.Xslt.MicrosoftXsltEngine.Transform(IXmlContainer data, Object xsltEngine, Hashtable parameters, String transactionId, IDataStructure outputStructure, Boolean validateOnly) in D:\a\1\s\backend\Origam.Rule\Xslt\MicrosoftXsltEngine.cs:line 251
   at Origam.Rule.Xslt.AbstractXsltEngine.Transform(IXmlContainer data, Guid transformationId, Guid retransformationId, Hashtable parameters, String transactionId, Hashtable retransformationParameters, IDataStructure outputStructure, Boolean validateOnly) in D:\a\1\s\backend\Origam.Rule\Xslt\AbstractXsltEngine.cs:line 178
   at Origam.Rule.Xslt.AbstractXsltEngine.Transform(IXmlContainer data, Guid transformationId, Hashtable parameters, String transactionId, IDataStructure outputStructure, Boolean validateOnly) in D:\a\1\s\backend\Origam.Rule\Xslt\AbstractXsltEngine.cs:line 137
   at Origam.Rule.RuleEngine.EvaluateEndRule(IEndRule rule, Object data, Hashtable parameters, Boolean parentIsTracing) in D:\a\1\s\backend\Origam.Rule\RuleEngine.cs:line 350
   --- End of inner exception stack trace ---
   at Origam.Rule.RuleEngine.EvaluateEndRule(IEndRule rule, Object data, Hashtable parameters, Boolean parentIsTracing) in D:\a\1\s\backend\Origam.Rule\RuleEngine.cs:line 383
   at Origam.Server.Pages.XsltPageRequestHandler.Execute(AbstractPage page, Dictionary`2 parameters, IRequestWrapper request, IResponseWrapper response) in D:\a\1\s\backend\Origam.Server\Pages\XsltPageRequestHandler.cs:line 0
   at Origam.Server.Pages.UserApiProcessor.Process(IHttpContextWrapper context) in D:\a\1\s\backend\Origam.Server\Pages\UserApiProcessor.cs:line 144

The problem is that your transformation does not return the element. An empy string is returned instead.
This apparently did not matter before (probably because of a bug), but it is wrong.

Please change the transformation so that the element is always returned.

After adding the ROOT element it fails with a different error.

2024-07-09 11:13:09,559 [16] ERROR Origam.Server.Pages.UserApiProcessor - Error occured (System.Exception) for request: 
                       //api/PersonalData_test: Rule evaluation failed. Rule: 'PersonalData_ValidateBody'
System.Exception: Rule evaluation failed. Rule: 'PersonalData_ValidateBody'
 ---> System.InvalidOperationException: There is an error in the XML document.
 ---> System.InvalidOperationException: <ROOT xmlns=''> was not expected.
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderRuleExceptionDataCollection.Read4_RuleExceptionDataCollection()
   --- End of inner exception stack trace ---
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader)
   at Origam.Rule.RuleEngine.EvaluateEndRule(IEndRule rule, Object data, Hashtable parameters, Boolean parentIsTracing) in D:\a\1\s\backend\Origam.Rule\RuleEngine.cs:line 364
   --- End of inner exception stack trace ---
   at Origam.Rule.RuleEngine.EvaluateEndRule(IEndRule rule, Object data, Hashtable parameters, Boolean parentIsTracing) in D:\a\1\s\backend\Origam.Rule\RuleEngine.cs:line 383
   at Origam.Server.Pages.XsltPageRequestHandler.Execute(AbstractPage page, Dictionary`2 parameters, IRequestWrapper request, IResponseWrapper response) in D:\a\1\s\backend\Origam.Server\Pages\XsltPageRequestHandler.cs:line 0
   at Origam.Server.Pages.UserApiProcessor.Process(IHttpContextWrapper context) in D:\a\1\s\backend\Origam.Server\Pages\UserApiProcessor.cs:line 144