Parse an XML String
hi lets say i got an XML String which looks like this..
String xmlstring = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><GET_REALIZED_GAIN_LOSS_DETAIL_RESPONSE xsi:schemaLocation=\"http://www.statementone.com/webservice/schemas D:\\PMTSchema.xsd\" xmlns=\"http://www.statementone.com/webservice/schemas\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><STATUS>true</STATUS><ERRORS><ERROR><TYPE>String</TYPE><MESSAGE>String</MESSAGE><ERROR_ID>1</ERROR_ID></ERROR><ERROR><TYPE>String</TYPE><MESSAGE>String</MESSAGE><ERROR_ID>1</ERROR_ID></ERROR></ERRORS><GET_REALIZED_GAIN_LOSS_RESULT><XYZ>String</XYZ></GET_REALIZED_GAIN_LOSS_RESULT></GET_REALIZED_GAIN_LOSS_DETAIL_RESPONSE>";
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
DocumentBuilder db = factory.newDocumentBuilder();
InputSource inStream = new InputSource();
inStream.setCharacterStream(new StringReader(xmlstring));
Document doc1 = db.parse(inStream);
I notice that all the values i set in XML are available in the doc1 field. But I was not able to get them as a string..
Can Some one tell me how to get the attributes out of the doc1? I tried getElementBytag and other options.. Do i need to take out the tag items in the sequence in which they are given? or can i select a tag random and pick up the attributes?
Plzz help me out!!

