setTypeAttribute(element, type);
} else {
// Copy the embedded type defition.
XmlElement clonedElementElement = XMLUtil
.deepClone(elementElement);
String typeString = clonedElementElement
.attributeValue(WSConstants.TYPE_ATTRIBUTE);
if (typeString == null) {
for (Object child : clonedElementElement.children()) {
if (child instanceof XmlElement) {
((XmlElement) child).setParent(null);