How to print empty string as a result from xml node creation using oracle in a procedure i want to print one of the node value as Author ="" empty string in xml node element as below:
This syntax is in oracle:

CREATE OR REPLACE FUNCTION GetRtData
(    
    pf_wkstn_oid_sh number, 
    pf_wkstn_oid_lng number
)
RETURN varchar2
IS RtData varchar2(10000);
BEGIN
    SELECT REPLACE(XMLElement("TableData", 
                         XMLAGG(XMLElement("rt",XMLAttributes(field_data_type as field_data_type,'' as Author))) 
                       ).getStringVal(),'&gt;&lt;/rt&gt;','/&gt;')
    INTO RtData
    FROM pmry_c_rt_flng  
    where wkstn_oid_sh = pf_wkstn_oid_sh 
    AND wkstn_oid_lng = pf_wkstn_oid_lng;  
    return RtData;
END;


it is returning as below.

SQL&gt; select GetRtData(100,4223) from dual;
GETRTDATA(100,4223)
----------------------------------------------------------------------------
&lt;TableData&gt;&lt;rt FIELD_DATA_TYPE="N"/&gt;&lt;/TableData&gt;

even Author has removed in oracle while creating the node using as ( '' as 
Author) in the above result.

i want the result as below format: 

&lt;TableData&gt;&lt;rt FIELD_DATA_TYPE="N" Author=""/&gt;&lt;/TableData&gt;


once i am using as

' ' as Author
&lt;TableData&gt;&lt;rt FIELD_DATA_TYPE="N" Author=" "/&gt;&lt;/TableData&gt; one extra space which is not empty string. 


so can any one help me how to handle this one to make as Author = "" only in oracle.
You use REPLACE in your code, with 1 more REPLACE:

SELECT REPLACE(XMLElement("TableData", 
          XMLAGG(XMLElement("rt",XMLAttributes(1 as file_data_type, '' as Author))) 
       ).getStringVal(),'&gt;&lt;/rt&gt;','/&gt;')
  as xml
FROM dual;

XML
--------------------------------------------------------------------------------
&lt;TableData&gt;&lt;rt FILE_DATA_TYPE="1"/&gt;&lt;/TableData&gt;



SELECT REPLACE(XMLElement("TableData", 
          XMLAGG(XMLElement("rt",XMLAttributes(1 as file_data_type, 'dummy' as Author))) 
       ).getStringVal(),'&gt;&lt;/rt&gt;','/&gt;')
  as xml
FROM dual;

XML
--------------------------------------------------------------------------------
&lt;TableData&gt;&lt;rt FILE_DATA_TYPE="1" AUTHOR="dummy"/&gt;&lt;/TableData&gt;



SELECT REPLACE(REPLACE(XMLElement("TableData", 
          XMLAGG(XMLElement("rt",XMLAttributes(1 as file_data_type, 'dummy' as Author))) 
        ).getStringVal(),'&gt;&lt;/rt&gt;','/&gt;'), 'dummy')
  as xml
FROM dual;

XML
--------------------------------------------------------------------------------
&lt;TableData&gt;&lt;rt FILE_DATA_TYPE="1" AUTHOR=""/&gt;&lt;/TableData&gt;