class XmlSettingsReader {

    public <T> T getComplexType(String tagName, Class<T> targetClass) {
        Node property = getElement(doc, tagName);

        if (property == null) {
            return null;
        }

        try {
            JAXBContext jc = JAXBContext.newInstance(targetClass);
            Unmarshaller unmarshaller = jc.createUnmarshaller();
            JAXBElement<T> jb = unmarshaller.unmarshal(property, targetClass);
            return jb.getValue();
        } catch (JAXBException e) {
            throw new IllegalArgumentException(
                    "Problem extracting " + targetClass + " from settings: " + e.getMessage());
        }
    }

    public  XmlSettingsReader(String xmlString);

}