We have released HavenOPML, an open source Swift package for reading and writing OPML files.

It supports both OPML 1.0 and 2.0. You can import an OPML file into structured outlines and export them back as valid XML. The package includes depth-first traversal helpers for walking nested outlines.

It is written in pure Swift with no outside dependencies. An actor-isolated service handles concurrent access safely.

The parser prevents XXE attacks, caps input at 10 megabytes, and limits nesting to 128 levels.

HavenOPML is what Haven Feeds uses when you import or export your feed subscriptions.

The code is on GitHub under the BSD 3-Clause licence.