OMElement parent, XPathSerializer xPathSerializer) {
OMElement serviceElement;
QNameFactory qNameFactory = QNameFactory.getInstance();
OMNamespaceFactory omNamespaceFactory = OMNamespaceFactory.getInstance();
OMElementHelper omElementHelper = OMElementHelper.getInstance();
if (parent != null) {
// removes existing rule config information in the service.xml
serviceElement = parent;
Iterator iterator = serviceElement.getChildElements();
while (iterator.hasNext()) {
Object o = iterator.next();
if (!(o instanceof OMElement)) {
continue;
}
OMElement child = (OMElement) o;
if (CommonsConstants.ELE_DESCRIPTION.equals(child.getLocalName())) {
omElementHelper.detachChildren(child);
String des = description.getDescription();
if (des != null && !"".equals(des.trim())) {
child.setText(des);
}
}