Hello. I have a table with a column of type BLOB that is storing the data in an XML.
I'm not able to get the values ​​of an XML element.
The average size of the XML files is 8000 characters.

Below is an example of the XML:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<nfeProc versao="2.00" xmlns="http://www.portalfiscal.inf.br/nfe">
	<protNFe versao="2.00">
		<infProt Id="NFe00">
			<tpAmb>1</tpAmb>
			<verAplic>GO2.0</verAplic>
			<chNFe>231123</chNFe>
			<dhRecbto>2012-09-11T17:25:57</dhRecbto>
			<nProt>152120285444248</nProt>
			<digVal>q+qkdkaDawldawWqcg=</digVal>
			<cStat>100</cStat>
			<xMotivo>Autorizado o uso da NF-e</xMotivo>
		</infProt>
	</protNFe>
</nfeProc>
Below are the functions that I am using to convert the BLOB to CLOB:
Code:
CREATE OR REPLACE FUNCTION BLOB2CLOB(L_BLOB BLOB) RETURN CLOB IS
    L_CLOB         CLOB;
    L_SRC_OFFSET      NUMBER;
    L_DEST_OFFSET  NUMBER;
    L_BLOB_CSID       NUMBER := DBMS_LOB.DEFAULT_CSID;
    V_LANG_CONTEXT NUMBER := DBMS_LOB.DEFAULT_LANG_CTX;
    L_WARNING         NUMBER;
    L_AMOUNT  NUMBER;
  BEGIN
   DBMS_LOB.CREATETEMPORARY(L_CLOB, TRUE);
    L_SRC_OFFSET     := 1;
    L_DEST_OFFSET := 1;
    L_AMOUNT := DBMS_LOB.GETLENGTH(L_BLOB);
    DBMS_LOB.CONVERTTOCLOB(L_CLOB,
                           L_BLOB,
                           L_AMOUNT,
                           L_SRC_OFFSET,
                           L_DEST_OFFSET,
                           1,
                           V_LANG_CONTEXT,
                           L_WARNING);
    RETURN L_CLOB;
  END;
Below is the query used:
Code:
SELECT dbms_lob.getlength(blob2clob(column_blob_xml)) length,
       extractValue(XMLTYPE(blob2clob(column_blob_xml)), '/nfeProc/protNFe/infProt/cStat') content,
       XMLTYPE(blob2clob(column_blob_xml)).extract('/nfeProc/protNFe/infProt/cStat/text()') content_clob
  FROM table_xml
Following the example XML above, I need the value contained in cStat element, ie 100.

Anyone have any idea how to get the value correctly?

Thank you.