You can use the Marshaler's method for marshaling which takes a Writer as parameter:
and pass it an Implementation which can build a String object
Direct Known Subclasses: BufferedWriter, CharArrayWriter, FilterWriter, OutputStreamWriter, PipedWriter, PrintWriter, StringWriter
Call its toString method to get the actual String value.
So doing:
StringWriter sw = new StringWriter();
jaxbMarshaller.marshal(customer, sw);
String xmlString = sw.toString();