}
}
if (unmarshalledObject instanceof XMLRoot) {
XMLRoot xmlRoot = (XMLRoot)unmarshalledObject;
XMLDocument xmlDocument = createDocument((DataObject)((XMLRoot)unmarshalledObject).getObject(), ((XMLRoot)unmarshalledObject).getNamespaceURI(), ((XMLRoot)unmarshalledObject).getLocalName());
if(xmlRoot.getEncoding() != null) {
xmlDocument.setEncoding(xmlRoot.getEncoding());
}
if(xmlRoot.getXMLVersion() != null) {
xmlDocument.setXMLVersion(xmlRoot.getXMLVersion());
}
xmlDocument.setSchemaLocation(xmlRoot.getSchemaLocation());
xmlDocument.setNoNamespaceSchemaLocation(xmlRoot.getNoNamespaceSchemaLocation());
return xmlDocument;
} else if (unmarshalledObject instanceof DataObject) {
String localName = ((SDOType)((DataObject)unmarshalledObject).getType()).getXmlDescriptor().getDefaultRootElement();
if (localName == null) {
localName = ((SDOType)((DataObject)unmarshalledObject).getType()).getXsdLocalName();