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.5.0(3w ago)12.6kMITPHPPHP ^8.1CI passing

Since Aug 11Pushed 3w 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 yesterday

READMEChangelog (5)Dependencies (4)Versions (8)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

45

—

FairBetter than 91% of packages

Maintenance95

Actively maintained with recent releases

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 ~258 days

Total

5

Last Release

21d 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 (63 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

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M47](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

45153.1k6](/packages/jstewmc-rtf)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.2k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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