PHPackages                             aaronddm/xml-builder - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. aaronddm/xml-builder

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

aaronddm/xml-builder
====================

A simple PHP based XML builder

v2.0.3(3y ago)28150.0k↓49.4%4[1 issues](https://github.com/AaronDDM/XMLBuilder/issues)1MITPHPPHP &gt;=7.2.0CI failing

Since Dec 28Pushed 3y ago2 watchersCompare

[ Source](https://github.com/AaronDDM/XMLBuilder)[ Packagist](https://packagist.org/packages/aaronddm/xml-builder)[ RSS](/packages/aaronddm-xml-builder/feed)WikiDiscussions main Synced yesterday

READMEChangelog (5)Dependencies (3)Versions (8)Used By (1)

PHP XML Builder Library
=======================

[](#php-xml-builder-library)

This is a simple PHP 7.2+ based XML Builder library. Use it to easily generate XML output with just PHP.

Table of Contents
-----------------

[](#table-of-contents)

- [PHP XML Builder Library](#php-xml-builder-library)
    - [Table of Contents](#table-of-contents)
    - [Installation](#installation)
    - [Prerequisites](#prerequisites)
    - [Basic Usage](#basic-usage)
        - [Example: Using XMLWriter](#example-using-xmlwriter)
        - [Output](#output)
        - [Example: Custom XMLWriter instance](#example-custom-xmlwriter-instance)
        - [Output](#output-1)
    - [Looping through data](#looping-through-data)
        - [Example: XML output of a list of users](#example-xml-output-of-a-list-of-users)
        - [Output](#output-2)
    - [Looping without a parent](#looping-without-a-parent)
        - [Example: XML output of a list of users](#example-xml-output-of-a-list-of-users-1)
        - [Output](#output-3)
    - [Using a custom "XMLElementData" class](#using-a-custom-xmlelementdata-class)
        - [Example: Customized MyXMLElementData class](#example-customized-myxmlelementdata-class)
        - [Output](#output-4)
    - [Running tests](#running-tests)
    - [License](#license)

Installation
------------

[](#installation)

```
composer require aaronddm/xml-builder

```

Prerequisites
-------------

[](#prerequisites)

- PHP &gt;=7.2.0
- php-xml if using XMLWriter

Basic Usage
-----------

[](#basic-usage)

The following is an example of the most basic usage of this library.

### Example: Using XMLWriter

[](#example-using-xmlwriter)

```
cd /root/of/project/
vendor/bin/phpunit
```

OR

```
docker build -t xmlbuilder .
docker run -u appuser -it --rm xmlbuilder vendor/bin/phpunit
```

License
-------

[](#license)

This project is open-sourced software licensed under the [MIT](https://opensource.org/licenses/MIT) license.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 88% 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 ~291 days

Total

7

Last Release

1357d ago

Major Versions

v1.0.2 → v2.0.02021-03-29

PHP version history (2 changes)v1.0.0PHP &gt;=7.1.0

v2.0.0PHP &gt;=7.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/ca4114726ca89362c3a10ff8f9ff366186ac477f4b7ebee108664a5533d14e9f?d=identicon)[AaronDDM](/maintainers/AaronDDM)

---

Top Contributors

[![AaronDDM](https://avatars.githubusercontent.com/u/314152?v=4)](https://github.com/AaronDDM "AaronDDM (44 commits)")[![PendalF89](https://avatars.githubusercontent.com/u/5278851?v=4)](https://github.com/PendalF89 "PendalF89 (2 commits)")[![ricklambrechts](https://avatars.githubusercontent.com/u/1367665?v=4)](https://github.com/ricklambrechts "ricklambrechts (2 commits)")[![deniskoronets](https://avatars.githubusercontent.com/u/5627329?v=4)](https://github.com/deniskoronets "deniskoronets (1 commits)")[![ZhenQ](https://avatars.githubusercontent.com/u/8407633?v=4)](https://github.com/ZhenQ "ZhenQ (1 commits)")

---

Tags

hacktoberfestphpphp-72php-8php-xmlxml-builderxml-builder-libraryxmlwriter

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aaronddm-xml-builder/health.svg)

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

PHPackages © 2026

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