@Override public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { HeaderSource headerSource = new HeaderSource(); headerSource.setName(reader.getAttribute("name")); headerSource.setDescription(reader.getAttribute("description")); headerSource.setOptional(Boolean.parseBoolean(reader.getAttribute("optional"))); headerSource.setLocation(reader.getValue()); return headerSource; } }