XmlSerializable bean = new XmlSerializable("a String", 42, true);
runtimeService.setVariable(instance.getId(), "simpleBean", objectValue(bean).serializationDataFormat(XML_FORMAT_NAME).create());
ObjectValue typedValue = runtimeService.getVariableTyped(instance.getId(), "simpleBean", false);
SpinXmlElement serializedValue = Spin.XML(typedValue.getValueSerialized());
assertEquals(bean.getStringProperty(), serializedValue.childElement("stringProperty").textContent());
assertEquals(bean.getBooleanProperty(), Boolean.parseBoolean(serializedValue.childElement("booleanProperty").textContent()));
assertEquals(bean.getIntProperty(), Integer.parseInt(serializedValue.childElement("intProperty").textContent()));
}