I have to initialize an element of type JAXBElement <String>, I have tried as follows:
JAXBElement<String> element = new JAXBElement<>(new QName("http://tempuri.org/", "FieldName"), String.class, "FieldData");
But I am not sure if it is the correct way. Can someone confirm if there is another easier way?