Fix: Update XMLContentsToString to use native methods