public void makeXml(Object object, Document doc, Element parent)
    throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, ClassNotFoundException {
        String className = object.getClass().getCanonicalName();
        String nameSpace = persistConf.getNameSpaceForClassName(className);

        String prefix = persistConf.getPrefixForNameSpace(nameSpace);

        String elemName = persistConf.getElementForClassName(className);
        Element element = doc.createElementNS(nameSpace, prefix + ":" + elemName);

        if (parent == null) {
            doc.appendChild(element);
        }
        else {
            parent.appendChild(element);
        }

        List<Method> methods = findMethodsForClass("get", object.getClass());
        for (Method method : methods) {
            Object methodResult = method.invoke(object);

            // if the result is a list of Tasks,
            // then iterate through each one and write it out as a sub-element
            if (methodResult instanceof List<?>) {
                for (Task nextTask : (List<Task>)methodResult) {
                    makeXml(nextTask, doc, element);
                }
            }
            // if the result is a Task,
            // then write it out as a sub-element
            else if (methodResult instanceof Task) {
                makeXml(methodResult, doc, element);
            }
            // if the result is not any of the above,
            // then write it out as an attribute
            else {
                String attrName = method.getName();
                attrName = attrName.replaceFirst("get", "");
                attrName = convertFromCamelCase(attrName);
                if (methodResult == null  || "null".equals(methodResult)) {
                    methodResult = "";
                }
                String resultString = methodResult.toString();
                element.setAttribute(attrName, resultString);
            }
        }
    }