private void doTestWriteJAXBCollection(String mName) throws Exception {
JAXBElementProvider provider = new JAXBElementProvider();
List<JAXBElement<Book>> books = new ArrayList<JAXBElement<Book>>();
books.add(new JAXBElement<Book>(new QName("Books"), Book.class, null,
new Book("CXF in Action", 123L)));
books.add(new JAXBElement<Book>(new QName("Books"), Book.class, null,
new Book("CXF Rocks", 124L)));
Method m = CollectionsResource.class.getMethod(mName, new Class[0]);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
provider.writeTo(books, m.getReturnType(), m.getGenericReturnType(),
new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, Object>(), bos);