// declare default namespace
marshaller.declareNamespace(null, "http://example.org/ns/books/");
// add schema location by declaring xsi namespace and adding xsi:schemaReader attribute
marshaller.declareNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
marshaller.addAttribute("xsi",
"schemaReader",
"string",
"http://example.org/ns/books/ resources/book/books.xsd"
);