How To Check Array Size In Javascript Object To Xml