public Element writePropertyNode(Element parent, Object o, String name) throws Exception {
      Element              node;
      PropertyNode         pnode;
      Vector               children;
      int                  i;
      Element              child;

      // for debugging only
      if (DEBUG)
         trace(new Throwable(), name);
      
      m_CurrentNode = parent;
      
      pnode = (PropertyNode) o;
      node  = (Element) parent.appendChild(m_Document.getDocument().createElement(TAG_OBJECT));
      node.setAttribute(ATT_NAME, name);
      node.setAttribute(ATT_CLASS, pnode.getClass().getName());
      node.setAttribute(ATT_PRIMITIVE, VAL_NO);
      node.setAttribute(ATT_ARRAY, VAL_NO);
      
      if (pnode.value != null)
         invokeWriteToXML(node, pnode.value, NAME_PROPERTYNODE_VALUE);
      if (pnode.parentClass != null)
         invokeWriteToXML(node, pnode.parentClass.getName(), NAME_PROPERTYNODE_PARENTCLASS);
      if (pnode.property != null)
         invokeWriteToXML(node, pnode.property.getDisplayName(), NAME_PROPERTYNODE_PROPERTY);
      
      // fix primitive values
      if (    (pnode.value != null) 
           && (pnode.property != null) 
           && (pnode.property.getPropertyType().isPrimitive())) {
         children = XMLDocument.getChildTags(node);
         for (i = 0; i < children.size(); i++) {
            child = (Element) children.get(i);
            if (!child.getAttribute(ATT_NAME).equals(NAME_PROPERTYNODE_VALUE))
               continue;
            child.setAttribute(ATT_CLASS, pnode.property.getPropertyType().getName());
            child.setAttribute(ATT_PRIMITIVE, VAL_YES);
         }
      }
      
      return node;
   }