The nodeValue returns a string/ text value.
Code:
month = (date.getElementsByTagName("month")[0].childNodes[0].nodeValue);
month = parseInt(month); // convert to a number - do the same for month.
Code:
membershipstatus = (x[i].getElementsByTagName("membership_status")[0].childNodes[0].nodeValue);
Are you inventing your own tag names? Perhaps you're using XHTML?
If you only have one element 'membership_status' then give it this
id and use 'getElementById'.
Is the value you need within the first child of the element? Depending on the type of element it is some browsers can insert
hidden text nodes or elements.