element - resources
parentSource - server element for source for as7.x. domain for 8.x
parentResult - domain element of result for 8.1PE, Config element for SE/EE
// There should only be one or zero resources element
if(!parentResult.getTagName().equals("domain")){
// This fix is required, otherwise it would create resources element under cofig element.
parentResult = parentResult.getOwnerDocument().getDocumentElement();
}
NodeList resources = parentResult.getElementsByTagName("resources");
Element resource = null;
if(resources.getLength() == 0){
resource = parentResult.getOwnerDocument().createElement("resources");
this.appendElementToParent(parentResult,resource);
}else {
resource = (Element)resources.item(0);
}
super.transform(element, parentSource, resource);