How to get the data type of an element in Document using Java API

Hi Gurus,

I am developing java services to Invoke a Insert service which inserts the data into Oracle 9i database. The java service receives the records in as XML string. The java code loops on each record, extracts elements and sets to the appropriate field. The input to the insert service is document, collection of Objects; Strings, BigInteger, Date etc… Now in java code how do I get the data type of the object? If I know the object’s data type then I can map the read data from the XML and construct the document for insert service. So could anyone help me how to get the data type using Java API.

Thanks in advance
Jo