Pessoal, boa noite.
Estou em uma busca já a 2 dias para conseguir ler um arquivo XML. Já utilizei todas as formas que o pessoal descreveu, não somente nesse forum mas em outros também e em nenhuma delas eu consegui ler esse arquivo xml:
<?xml version="1.0"?>
-<retConsStatServ xmlns="http://www.portalfiscal.inf.br/nfe" versao="2.00">
<tpAmb>2</tpAmb>
<verAplic>SP_NFE_PL_006q</verAplic>
<cStat>107</cStat>
<xMotivo>Serviço em Operação</xMotivo>
<cUF>35</cUF>
<dhRecbto>2014-01-08T19:08:57</dhRecbto>
<tMed>1</tMed>
</retConsStatServ>
Eu gostaria apenas de ler o campo xMotivo.
Alguem poderia me dar uma luz?!
Segue o trecho do código que estou tentando utilizar:
File arquivo = new File("C:/Unimake/UniNFe/00999741000128/Retorno/20140108T190850-sta.xml");
SAXBuilder sb = new SAXBuilder();
Document doc = sb.build(arquivo);
Element retConsStatServ = doc.getRootElement();
jTextArea1.append("\n"+retConsStatServ.getAttributeValue("versao"));
List<Element> xMotivo = retConsStatServ.getChildren("xMotivo");
Element a = xMotivo.get(0);
jTextArea1.append("\n"+a.getValue());
Desde já obrigado!