@SuppressWarnings("Duplicates")
    public static Marshaller createMarshaller(String encoding, boolean formatted) throws JAXBException {
    """
	Creates a {@link Marshaller} to write JAXB objects into XML.
	
	@param encoding  encoding of written XML
	@param formatted if written XML is pretty printed
	@return created marshaller
	@throws JAXBException if a problem with JAXB occurred
    """
        Marshaller m = getContext().createMarshaller();
        m.setProperty(Marshaller.JAXB_ENCODING, encoding);
        m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, formatted);
        m.setEventHandler(new XmlValidationHandler());
        return m;
    }
@SuppressWarnings("Duplicates")
    public static Marshaller createMarshaller(String encoding, boolean formatted) throws JAXBException {
        Marshaller m = getContext().createMarshaller();
        m.setProperty(Marshaller.JAXB_ENCODING, encoding);
        m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, formatted);
        m.setEventHandler(new XmlValidationHandler());
        return m;
    }
@ SuppressWarnings ( "Duplicates" ) public static Marshaller createMarshaller ( String encoding , boolean formatted ) throws JAXBException { Marshaller m = getContext ( ) . createMarshaller ( ) ; m . setProperty ( Marshaller . JAXB_ENCODING , encoding ) ; m . setProperty ( Marshaller . JAXB_FORMATTED_OUTPUT , formatted ) ; m . setEventHandler ( new XmlValidationHandler ( ) ) ; return m ; }
Creates a {@link Marshaller} to write JAXB objects into XML.

@param encoding  encoding of written XML
@param formatted if written XML is pretty printed
@return created marshaller
@throws JAXBException if a problem with JAXB occurred
Creates a { @link Marshaller } to write JAXB objects into XML .