Amit - if you don't mind, a few questions for clarification.
First, what do you mean by "unknown special character"? ' is not an unknown character. It is an XML entity ("entity" is a technical XML term) representing "apostrophe".
Second, what do you mean by "the same output"? XMLTYPE returns a value of data type XMLTYPE. In XML, ' is exactly the same as a single apostrophe. Instead, I believe you are viewing the value on screen, as a string (the string representation of an XML tag) - and you want that to look like your input. That, as Chris demonstrated, is a matter of serializing your XMLTYPE value; but your value as you reported it is ALREADY the same as the input, as XMLTYPE values. (For comparison, 003 and 3 may not look the same on screen; but as NUMBERS, not as strings, they are the same!)
In any case, I am unable to reproduce what you reported. Using SQL Developer on a Windows 11 machine running Oracle 19.3, and running the query as a "script" (if I run it as a "query" the output will simply show <XMLTYPE> as the output, but then if I double-click on it I get the same output as when I run as "script"):
select banner_full from v$version;
BANNER_FULL
------------------------------------------------------------------------------------------
"Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0"
select XMLTYPE('<tag1> a''bc </tag1>') from dual;
XMLTYPE('<TAG1>A''BC</TAG1>')
-----------------------------
<tag1> a'bc </tag1>I see the same output (with an actual apostrophe, not an XML entity representing it) on LiveSQL.Oracle.com. This seems to suggest that your observation may be rather dependent on your user interface. What IDE are you using to run your queries?