# XML Node

{% hint style="info" %}
Webstudio automatically generates a sitemap for static pages such as Home and About. If you are integrating with a CMS, you can use this component to create a sitemap for CMS data.
{% endhint %}

<figure><img src="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-c01e838c4799f0aa78ec70abe0326a3305b4dd18%2Fxml-component.png?alt=media" alt=""><figcaption><p>Will display when Document Type is set to "XML"</p></figcaption></figure>

### How to use the XML Node component

1. Go to Page Settings > Document Type and select XML from the dropdown

   <figure><img src="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-7dc118c1dc6488075f3cc0ff3c5b4470b0c6695f%2Fpage-settings-xml-doc-type.png?alt=media" alt="Page Settings Document Type to XML"><figcaption></figcaption></figure>
2. Go to Components > XML and add XML Node (this component won’t show until Step 1 is completed)
3. Set the tag and text content (e.g., “loc” and “<https://example.com>)

### Tips

* XML Nodes can be nested within each other
* Use [Collection](https://docs.webstudio.is/university/core-components/collection) to iterate over a list of data
* A sitemap skeleton is available in the Marketplace

### Including the static sitemap

While you can use the autogenerated sitemap for static pages and create a separate sitemap for dynamic pages, you can also combine the two.

To include the static sitemap data in your custom sitemap, follow these steps:

1. Create a page
2. In the page settings, set the Document Type to XML
3. Set the page path to /sitemap.xml. This will override the default sitemap.
4. Fetch the static data by clicking Create Variable > System Resource (Type) > Sitemap (Resource)

   <figure><img src="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-76a209ec2bd92c33099867c9c7a7d223e720f2d7%2Fstatic-sitemap-data.png?alt=media" alt=""><figcaption></figcaption></figure>
5. Use a [Collection](https://docs.webstudio.is/university/core-components/collection) to iterate over the static sitemap data

## Related

* [XML Time](https://docs.webstudio.is/university/core-components/xml-time) – ISO date formatting for feeds
* [Collection](https://docs.webstudio.is/university/core-components/collection) – Iterate over feed items
* [Head Slot](https://docs.webstudio.is/university/core-components/head-slot) – Add meta tags


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.webstudio.is/university/core-components/xml-node.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
