PHPackages                             xp-framework/xml - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. xp-framework/xml

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

xp-framework/xml
================

XML APIs for the XP Framework

v12.0.0(2y ago)2106.7k↓21.9%6BSD-3-ClausePHPPHP &gt;=7.4.0

Since Jan 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/xp-framework/xml)[ Packagist](https://packagist.org/packages/xp-framework/xml)[ Docs](http://xp-framework.net/)[ RSS](/packages/xp-framework-xml/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (25)Used By (6)

XML APIs for the XP Framework
=============================

[](#xml-apis-for-the-xp-framework)

[![Build status on GitHub](https://github.com/xp-framework/xml/workflows/Tests/badge.svg)](https://github.com/xp-framework/xml/actions)[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)[![Requires PHP 7.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_0plus.svg)](http://php.net/)[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)[![Latest Stable Version](https://camo.githubusercontent.com/99e7d76672ae75ac0a4f53d0fbf8f438659081c3945fa2689a1c20dbcde9dc35/68747470733a2f2f706f7365722e707567782e6f72672f78702d6672616d65776f726b2f786d6c2f76657273696f6e2e737667)](https://packagist.org/packages/xp-framework/xml)

The xml package provides APIs to handle XML.

XML data
--------

[](#xml-data)

Most of the time, XML is used to hold data. In this case, a fully blown DOM api is too much overhead to work with the data. This is where the xml.Tree class comes in.

This example will print out a nicely formatted XML document:

```
use xml\{Tree, Node};

$t= new Tree('customer');
$t->root()->setAttribute('id', '6100');
$t->addChild(new Node('name', 'Timm Übercoder'));
$t->addChild(new Node('email', 'uebercoder@example.com'));

echo $t->getSource(INDENT_DEFAULT);
```

XSL Transformation
------------------

[](#xsl-transformation)

The DomXSLProcessor class uses LibXSLT and thus supports EXSLT features like user functions, callbacks, string functions, dynamic evaluation and more.

A simple example:

```
use xml\DomXSLProcessor;
use xml\TransformerException;
use util\cmd\Console;

$proc= new DomXSLProcessor();
$proc->setXSLFile('test.xsl');
$proc->setXMLFile('test.xml');

try {
  $proc->run();
} catch (TransformerException $e) {
  // Handle
}

Console::writeLine($proc->output());
```

XPath queries
-------------

[](#xpath-queries)

```
use xml\XPath;
use util\cmd\Console;

$xml= '
 Open a file

';

Console::writeLine((new XPath($xml))->query('/dialog/buttons/button/@name')));
```

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 83.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~146 days

Recently: every ~222 days

Total

24

Last Release

780d ago

Major Versions

v7.0.1 → v8.0.02016-08-28

v8.0.2 → v9.0.02017-05-29

v9.0.4 → v10.0.02020-04-10

v10.0.0 → v11.0.02021-10-21

v11.3.0 → v12.0.02024-03-29

PHP version history (5 changes)v6.0.0PHP &gt;=5.4.0

v6.3.0PHP &gt;=5.5.0

v8.0.0PHP &gt;=5.6.0

v10.0.0PHP &gt;=7.0.0

v12.0.0PHP &gt;=7.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/07d18d882c8b4aaf3466432f64018214f2771eda333202175431ee7233795376?d=identicon)[thekid](/maintainers/thekid)

---

Top Contributors

[![thekid](https://avatars.githubusercontent.com/u/696742?v=4)](https://github.com/thekid "thekid (14321 commits)")[![kiesel](https://avatars.githubusercontent.com/u/127769?v=4)](https://github.com/kiesel "kiesel (2390 commits)")[![ohinckel](https://avatars.githubusercontent.com/u/717217?v=4)](https://github.com/ohinckel "ohinckel (335 commits)")[![Stormwind](https://avatars.githubusercontent.com/u/836872?v=4)](https://github.com/Stormwind "Stormwind (13 commits)")[![andstefiul](https://avatars.githubusercontent.com/u/798415?v=4)](https://github.com/andstefiul "andstefiul (5 commits)")[![kusnier](https://avatars.githubusercontent.com/u/726429?v=4)](https://github.com/kusnier "kusnier (5 commits)")[![beorgler](https://avatars.githubusercontent.com/u/2027220?v=4)](https://github.com/beorgler "beorgler (3 commits)")[![treuter](https://avatars.githubusercontent.com/u/1067905?v=4)](https://github.com/treuter "treuter (3 commits)")[![ppetermann](https://avatars.githubusercontent.com/u/69334?v=4)](https://github.com/ppetermann "ppetermann (1 commits)")[![guel1973](https://avatars.githubusercontent.com/u/4669852?v=4)](https://github.com/guel1973 "guel1973 (1 commits)")

---

Tags

phpxmlxp-frameworkmodulexp

### Embed Badge

![Health badge](/badges/xp-framework-xml/health.svg)

```
[![Health](https://phpackages.com/badges/xp-framework-xml/health.svg)](https://phpackages.com/packages/xp-framework-xml)
```

###  Alternatives

[xp-framework/compiler

XP Compiler

2026.0k9](/packages/xp-framework-compiler)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
