PHPackages                             elecena/xml-iterator - 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. elecena/xml-iterator

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

elecena/xml-iterator
====================

Memory efficient and fast XML parser with iterator interface

0.4.0(1y ago)12.3k[1 issues](https://github.com/elecena/xml-iterator/issues)MITPHPPHP ^8.1CI passing

Since Aug 11Pushed 3mo agoCompare

[ Source](https://github.com/elecena/xml-iterator)[ Packagist](https://packagist.org/packages/elecena/xml-iterator)[ RSS](/packages/elecena-xml-iterator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (7)Used By (0)

xml-iterator
============

[](#xml-iterator)

[![Test](https://github.com/elecena/xml-iterator/actions/workflows/php.yml/badge.svg)](https://github.com/elecena/xml-iterator/actions/workflows/php.yml)

Memory efficient and fast XML parser with [the iterator interface](https://www.php.net/manual/en/class.iterator.php).

Usage example
-------------

[](#usage-example)

Getting the list of sub-sitemaps in [the remote XML sitemap file](https://elecena.pl/sitemap.xml).

```
use Elecena\XmlIterator\XMLParser;
use Elecena\XmlIterator\Nodes\XMLNodeOpen;
use Elecena\XmlIterator\Nodes\XMLNodeContent;

require 'vendor/autoload.php';

$stream = fopen('https://elecena.pl/sitemap.xml', mode: 'rt');

foreach(new XMLParser($stream) as $node) {
    if ($node instanceof XMLNodeContent && $node->name === 'loc') {
		echo "Sub-sitemap found: {$node->content}\n";
    }
	elseif ($node instanceof XMLNodeOpen && $node->name === 'sitemapindex') {
		echo "Sitemap index node found, attributes: " . print_r($node->attributes, return: true) . "\n";
	}
}

fclose($stream);
```

The above will give you:

```
Sitemap index node found: Array
(
    [xmlns] => http://www.sitemaps.org/schemas/sitemap/0.9
)

Sub-sitemap found: https://elecena.pl/sitemap-001-search.xml.gz
Sub-sitemap found: https://elecena.pl/sitemap-002-shops.xml.gz
Sub-sitemap found: https://elecena.pl/sitemap-003-pages.xml.gz
Sub-sitemap found: https://elecena.pl/sitemap-004-datasheets.xml.gz
Sub-sitemap found: https://elecena.pl/sitemap-005-datasheets.xml.gz
Sub-sitemap found: https://elecena.pl/sitemap-006-datasheets.xml.gz
(...)

```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance44

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~173 days

Total

4

Last Release

490d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1929317?v=4)[Maciej Brencz](/maintainers/macbre)[@macbre](https://github.com/macbre)

---

Top Contributors

[![macbre](https://avatars.githubusercontent.com/u/1929317?v=4)](https://github.com/macbre "macbre (61 commits)")

---

Tags

iteratorphp-libraryxml-parser

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/elecena-xml-iterator/health.svg)

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

###  Alternatives

[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k89.3M627](/packages/jms-serializer-bundle)[hassankhan/config

Lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files

97513.5M170](/packages/hassankhan-config)[meyfa/php-svg

Read, edit, write, and render SVG files with PHP

54613.9M42](/packages/meyfa-php-svg)

PHPackages © 2026

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