XNameContainer NC = null;
try {
NC = (XNameContainer)
AnyConverter.toObject(new Type(XNameContainer.class),oldValue);
NC.insertByName("MyAttribute",
new AttributeData("","CDATA","Value"));
} catch ( com.sun.star.lang.IllegalArgumentException e ) {
log.println("Failed to check 'UserDefinedAttributes'");
e.printStackTrace(log);
} catch ( com.sun.star.lang.WrappedTargetException e ) {
log.println("Failed to check 'UserDefinedAttributes'");