Improvements on missing API's and listener cleanup on XMLSocket