Document doc = new Document();
Element rootElement = new Element("mbeans");
doc.setRootElement(rootElement);
/* mbeans */
for(ObjectName objName:objectNames){
ObjectInfo objInfo = connection.getObjectInfo(objName);
Element mbeanElement = new Element("mbean");
mbeanElement.setAttribute("name", objInfo.getObjectName().toString());
mbeanElement.setAttribute("description", objInfo.getDescription());
/* attributes */
for(ObjectAttributeInfo attrInfo:objInfo.getAttributes()){
Element attrElement = new Element("attribute");
attrElement.setAttribute("name", attrInfo.getName());
attrElement.setAttribute("description", attrInfo.getDescription());
mbeanElement.addContent(attrElement);
}
/* operations */
for(ObjectOperationInfo oprInfo:objInfo.getOperations()){
Element oprElement = new Element("operation");
oprElement.setAttribute("name", oprInfo.getName());
oprElement.setAttribute("description", oprInfo.getDescription());
/*parameters*/
for(ObjectParameterInfo paramInfo: oprInfo.getSignature()){