How to get attribute values by using the following code i am getting ; as output for msg . I want to print MSID,type,CHID,SPOS,type,PPOS values can any one solve this issue .

```
String xml1="<message MSID='20' type='2635'>"
        +"<che CHID='501' SPOS='2'>"
        +"<pds type='S'>"
        +"<position PPOS='S01'/>"
        +"</pds>"
        +"</che>"
        +"</message>";

InputSource source = new InputSource(new StringReader(xml1));

DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document document = db.parse(source);

XPathFactory xpathFactory = XPathFactory.newInstance();
XPath xpath = xpathFactory.newXPath();

String msg = xpath.evaluate("/message/che/CHID", document);
String status = xpath.evaluate("/pds/position/PPOS", document);

System.out.println("msg=" + msg + ";" + "status=" + status);

```