if (primitive)
if (primitive) {
   public void writeToXML(Element parent, Object o, String name) throws Exception {      String               classname;      Element              node;      Hashtable            memberlist;      Enumeration          enm;      Object               member;      String               memberName;      Method               method;      PropertyDescriptor   desc;      boolean              primitive;      boolean              array;      int                  i;            // get information about object      array = o.getClass().isArray();      if (array) {         classname = o.getClass().getComponentType().getName();         primitive = o.getClass().getComponentType().isPrimitive();       }      else {         // try to get property descriptor to determine real class         // (for primitives the getClass() method returns the corresponding Object-Class!)         desc = null;         if (parent != null)            desc = determineDescriptor(parent.getAttribute(ATT_CLASS), name);                  if (desc != null)            primitive = desc.getPropertyType().isPrimitive();          else            primitive = o.getClass().isPrimitive();          // for primitives: retrieve primitive type, otherwise the object's real          // class. For non-primitives we can't use the descriptor, since that         // might only return an interface as class!         if (primitive)            classname = desc.getPropertyType().getName();         else            classname = o.getClass().getName();      }            // fix class/primitive if parent is array of primitives, thanks to       // reflection the elements of the array are objects and not primitives!      if (    (parent != null)            && (stringToBoolean(parent.getAttribute(ATT_ARRAY)))           && (stringToBoolean(parent.getAttribute(ATT_PRIMITIVE))) ) {         primitive = true;         classname = parent.getAttribute(ATT_CLASS);      }      // create node for current object      node = addElement(parent, name, classname, primitive, array);            // array? -> save as child with 'name="<index>"'      if (array) {         for (i = 0; i < Array.getLength(o); i++) {            invokeWriteToXML(node, Array.get(o, i), Integer.toString(i));         }      }      // non-array      else {         // primitive? -> only toString()         if (primitive) {            node.appendChild(node.getOwnerDocument().createTextNode(o.toString()));         }         // object         else {            // process recursively members of this object             memberlist = getDescriptors(o);            // if no get/set methods -> we assume it has String-Constructor            if (memberlist.size() == 0) {               if (!o.toString().equals(""))                  node.appendChild(node.getOwnerDocument().createTextNode(o.toString()));            }            else {               enm = memberlist.keys();               while (enm.hasMoreElements()) {                  memberName = enm.nextElement().toString();                                    // in ignore list?                  if (m_Properties.isIgnored(getPath(node) + "." + memberName))                     continue;                  // in ignore list of class?                  if (m_Properties.isIgnored(o, getPath(node) + "." + memberName))                     continue;                  // is it allowed?                  if (!m_Properties.isAllowed(o, memberName))                     continue;                                    desc   = (PropertyDescriptor) memberlist.get(memberName);                  method = desc.getReadMethod();                  member = method.invoke(o, null);                  invokeWriteToXML(node, member, memberName);               }            }         }      }   }