class XMLUtilities {

    public static <T> T jaxbClone(T jaxbObject, Class<T> target)
    {
        if (jaxbObject != null)
        {
            try
            {
                ByteArrayOutputStream output = new ByteArrayOutputStream();
                writeXMLObject(jaxbObject, output);
                return readXMLObject(new ByteArrayInputStream(output.toByteArray()), target);
            }
            catch (JAXBException e)
            {
                LOGGER.error(e, e);
            }
        }

        return jaxbObject;
    }

    private  XMLUtilities();

}