Does FooClass have the XmlRootElement annotation? If not, try:
Source source = new StreamSource(inputStream);
JAXBElement<FooClass> root = unmarshaller.unmarshal(source, FooClass.class);
FooClass foo = root.getValue();
That’s based on the Unofficial JAXB Guide.