To answer the question, there are some ways, one that I find sensible and robust would be to look for a good library to do Parsing from XML to Java, possibly some that is already available in the standard language library, and learn how to use it to parse your XML. I suggest as keywords for this in the search engine of your preference XML
parser
Java
library
. I will not give suggestions because this information changes and would leave the answer outdated.
Although some certainly provide features to automatically browse XML in search of what you want, the most likely way to use will be you, upon prior knowledge of the parts that make up the XML tree (I only found this information in English, for example here) and the format of the XML data coming in the web service, specify via programming when using the library by which parts you need to navigate in XML until you find the desired information (for example, in your case you would have to specify to enter the root element books
, inside navigate through each (Obs.: cacophagus) one of the elements book
and from each extract the text of the element isbn
contained in it). Also keep in mind that, because it is a tree type data structure, typical terms of this structure can be used in the library such as Node or knot.
For small data sets like conventional returns from a web service there is no problem if the library performs all the loading and processing directly in memory, whereas in the case of larger XML’s it may be interesting to search for a more robust, to do a gradual loading and processing. That would be more for archives.
Other ways that are generally less robust to do, but can serve if you are sure of the data pattern that will always come, would be to fetch and extract the information you want using regular expressions or search inside the string for substrings. But like I said, it’s more plastered and less maintainable in the general case.