// how to read (unmarshal) XML with JAXB

// generated classes
import com.mindprod.poster.soapresponse.ProductInformation;
import com.mindprod.poster.soapresponse.Products;
import com.mindprod.poster.soapresponse.SearchResult;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import java.io.StringReader;


// com.mindprod.poster.soapresponse is the package where the JAXB generated Java classes live.
final JAXBContext jc = JAXBContext.newInstance( "com.mindprod.poster.soapresponse" );
final Unmarshaller u = jc.createUnmarshaller();
// SearchResult is the JAXB generated class for the entire document, the master enclosing tag.
// response contains a string with the XML to parse.
final SearchResult sr = (SearchResult) u.unmarshal( new StringReader( response ) );