Added function to clean XS library