*/
public Object wrapObjectInXMLRoot(Object object, String elementNamespaceUri, String elementLocalName, String elementPrefix, String encoding, String version, boolean forceWrap, boolean isNamespaceAware, XMLUnmarshaller unmarshaller) {
if (forceWrap || shouldWrapObject(object, elementNamespaceUri, elementLocalName, elementPrefix, isNamespaceAware)) {
// if the DOMRecord element != descriptor's default
// root element, create an XMLRoot, populate and return it
Root xmlRoot = new XMLRoot();
xmlRoot.setLocalName(elementLocalName);
xmlRoot.setNamespaceURI(elementNamespaceUri);
xmlRoot.setObject(object);
xmlRoot.setEncoding(encoding);
xmlRoot.setVersion(version);
setDeclaredTypeOnXMLRoot(xmlRoot, elementNamespaceUri, elementLocalName, isNamespaceAware, unmarshaller);
return xmlRoot;
}
return object;