if (Constants.XSD_ANYTYPE.equals(type)) {
Context context = engine.getCx();
OMElement element = omElement.getFirstElement();
if (element != null) {
Object[] objects = {element};
return context.newObject(engine, "XML", objects);
} else if (omElement.getText() != null) {
OMAttribute omAttribute = omElement.getAttribute(new QName("http://www.w3.org/2001/XMLSchema-instance", "type"));
if (omAttribute != null) {
String value = omAttribute.getAttributeValue();
if (value != null && !value.trim().equals("")) {