I am using Spring's Jaxb2Marshaller to unmarshall a java object into an XML file. The unmarshalling has been successful. But I want to add the doctype declaration to the XML.
I have searched a lot. Does here anybody knows how to add the doctype declaration to the xml ? Please help
Current XML
<?xml version="1.0" encoding="ISO-8859-1"?>
<rootElement>
Expected XML
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE XYZ PUBLIC "FPNID" "ABC.dtd">
<rootElement>