---
title: "How to convert XML data to a linked collection of PSML documents"
source: https://dev.pageseeder.com/get_started/tutorials/how_to_convert_xml_data_to_psml_documents_with_xrefs.html
last_updated: 2026-08-11T16:20:22+10:00
tokens: ~722
---

# How to convert XML data to a linked collection of PSML documents

| Property | Value |
| --- | --- |
| Skills required | XML, XSLT |
| Time required (minutes) | 30 |
| Intended audience | Developer |
| Difficulty | Medium |
| Category | Document |

## Objective

PSML documents are often linked together using cross-references ([XRefs](/reference/glossary/cross_reference.md)). This tutorial will demonstrate how use [XSLT](http://www.w3.org/TR/xslt20) to convert two XML files generated by Wikipedia to [PSML](/psml.md) documents linked together with XRefs. After conversion, the PSML can be uploaded to PageSeeder for checking.

## Prerequisites

To complete this tutorial requires:

- Software to read and write zip files (e.g. **7-Zip** or on Windows right-click “Extract all/Send to Compressed”).
- Access with a contributor role (at least) to the tutorial group.

The necessary files for this tutorial are on [Github](https://github.com/pageseeder/pageseeder-tutorials/tree/master/converting_xml_to_psml_with_xrefs).

### Run the XSLT code

The easiest way to do this is to follow the instructions in [How to run XSLT from Eclipse](/get_started/tutorials/how_to_run_xslt_from_eclipse.md), but if the Eclipse IDE is not available, follow [How to run XSLT from the command line](/get_started/tutorials/how_to_run_xslt_from_the_command_line.md). When doing this, use the following:

- `xrefs` - the name of the data folder.
- `wikipediafilms.xml` – the input XML film data.
- `films-bios.xsl` – the XSLT code.
- `wikipediabios.xml` – the input XML bio data. *This must be in the same folder as the XSLT code.*

This process will create files in the output folder using the following naming pattern:

```text
bios/bio-[n].psml
films/film-[n].psml
```

or

```text
bios/bio-1.psml
bios/bio-2.psml
bios/bio-3.psml
etc....
films/film-1.psml
films/film-2.psml
films/film-3.psml
etc....
```

Before continuing, open some sample files in a text editor to check the content. Also, to understand the XSLT conversion code or PSML markup, review `wikipediafilms.xml`, `wikipediabios.xml` and `films-bios.xsl`.

### Include images

Adding images to the collection requires storing the image files in a paths relative to the text. For example, the following:

```text
xrefs\bios\images
xrefs\films\images
```

Copy the film images from Github to these folder.

### Package and upload the PSML

The final step requires moving the data from a local file system into PageSeeder. Do this via the following steps:

'Zip' the `films` and `bios` folders into a single zip archive. 

Upload the archive to the PageSeeder group

![“Plus” button – Upload document](/content/images/tutorials/plus_button_upload_v60000.webp)

Don’t forget to **Unzip**!

![Upload documents – Unzip button](/content/images/tutorials/upload_unzip_v60000.webp)

After unzipping the archive, simply continue through the upload.

