Element element = ...
//create a preformatted text for any kind of element
String text =RepresentationTextCreator.getRepresentedText(element);
//create a text with special options for com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property
Property property = ...;
String propertyString = RepresentationTextCreator.createPropertyText(property, true, true, true, true, true, false, false, false, true, false);