How to Find and Use the XML Viewer Web Part in SharePoint Online
Question details
The user needs to display XML files as HTML using XSLT but cannot find the XML Viewer web part in SharePoint Online. Additionally, linking an internal XML file causes a URL retrieval error.

- Product
- SharePoint Online
- Device & OS
- not provided
- Scenario
- Attempting to embed and format XML data using the XML Viewer web part and linking to an XML file stored within a SharePoint document library.
- Observed behavior
- The XML Viewer web part is completely missing from the modern page interface. When successfully added elsewhere, entering the XML file path yields a 'Cannot retrieve the URL specified in the XML link property' error.
Ensure you have Site Administrator permissions in SharePoint Online, as you may need to run PowerShell commands to allow custom scripts or adjust document library permissions.
Add the XML Viewer via Classic Web Part Pages
The XML Viewer web part is not supported on modern SharePoint pages. You must create a classic page to access and use this feature.
Microsoft has deprecated several classic web parts in the modern SharePoint experience, including the XML Viewer. To use it, you need to revert to a classic Web Part Page.
Click the gear icon in the top right corner of your SharePoint site and select 'Site Contents'.
Open the 'Site Pages' library, click 'New', and look for 'Web Part Page'. If not available, create a basic page and switch to the classic experience via the bottom-left prompt.
Click 'Add a Web Part' inside any layout zone on your classic page.
In the categories menu, select 'Content Rollup'. Choose 'XML Viewer' from the available parts and click 'Add'.

Enable Custom Script in SharePoint Admin
If the XML Viewer is still missing on classic pages, custom scripting might be disabled at the tenant level.
Resolve the XML Link URL Error
Fix the 'Cannot retrieve the URL specified' error by ensuring proper URL formatting and file permissions.
Manage Your Documents Effectively with WPS Office
While SharePoint handles complex web parts and server-side features, WPS Office provides a lightweight, free alternative for creating, editing, and managing your everyday office documents with complete format compatibility.
- 1. Download and Install: Visit the official WPS website to download and install WPS Office Free on your device.
- 2. Open Your Documents: Launch WPS Office and choose the Writer, Spreadsheet, or Presentation module.
- 3. Manage Files Seamlessly: Click 'Open' to browse your local files or connect your preferred cloud storage to easily manage and edit your documents.

Frequently Asked Questions
Why is the XML Viewer web part missing in modern SharePoint pages?
Microsoft has phased out several classic web parts, including the XML Viewer, in the modern SharePoint experience to prioritize newer security and design frameworks. It can now only be accessed by creating a classic Web Part Page.
How do I link an XML file correctly in the XML Viewer web part?
You must use the fully qualified, absolute SharePoint URL (e.g., https://tenant.sharepoint.com/sites/site/library/file.xml) instead of a relative path or a local file path. Ensure the URL points directly to the file extension.
What does the 'Cannot retrieve the URL specified' error mean in SharePoint?
This error typically occurs when the provided URL in the XML link property is invalid, formatted as a relative path, or if the current users attempting to load the page lack the required read permissions for the document library where the XML file is hosted.




