}
else
{
// A pattern - return all matching MBeans
Set names = new TreeSet(CommandProcessorUtil.createObjectNameComparator());
names.addAll(server.queryNames(objectName, null));
Element root = document.createElement("Server");
root.setAttribute("pattern", objectName.toString());
for (Iterator it = names.iterator(); it.hasNext();)
{
Element mb = createMBeanElement(document, (ObjectName)it.next(), in);