fixed undefined length when neither max nor ids options are specified inside SearchResult.toXML function