/*
*
* create a xml document from the assigned form.
* @param formName - the assigned form name
* @param xmlEncoding - the character encoding of xml document
* @return a xml docment
*/
function
form2XmlDoc(formName, xmlEncoding) {
var
xml
=
"
<?xml version=\
"
1.0
\
"
encoding=\
""
+ xmlEncoding +
"
\
"
?>\n
"
;
xml
+=
"
<FORM>\n
"
;
var
vForm
=
document.forms[formName];
for
(
var
i
=
0
; i
<
vForm.length; i
++
) {
var
tmpName
=
vForm[i].name;
if
(tmpName)
xml
+=
"
<
"
+
tmpName
+
"
>
"
+
vForm[i].value
+
"
</
"
+
tmpName
+
"
>\n
"
}
xml
+=
"
</FORM>
"
;
return
xml;
}