* when I run my XQU script using a transformation scenario, the entities are untouched (= everything is OK)* when I run my XQU script using a custom refactoring operation, the entities are expanded. This leads to my XML not well-formed ("&amp;" is changed to "&")

We have a predefined XQuery script for converting attributes to elements (OXYGEN_INSTALL_DIR\refactoring\convert-attribute-to-element.xq), I tried to use the conversion on an XML which has both &quot; and &amp; but I cannot reproduce the problem (I tested with both Oxygen 19.1 and 20.1).Would it be possible for you to send us a sample XQuery update operation (XML descriptor + Xquery + maybe sample XML document) with which we could reproduce the problem on our side? You can also send us an email to support@oxygenxml.com if you do not want to paste the script here.

Can you reproduce with the following script? Am I missing something in the serialisation options? Again, it works in the transformation scenario and only fails when called from the XML refactoring menu.

I can reproduce the problem with your samples, we'll look into fixing this, I will update this forum thread when we do. If I find a workaround for this current behavior I will update this forum thread. in the meantime you could try to use an XSLT script instead.