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

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

xarenisoft/xml
==============

XmlModel

0.2.9(1y ago)196PHPPHP &gt;=7.0.0CI failing

Since Nov 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/DanNYSPD/Transformation)[ Packagist](https://packagist.org/packages/xarenisoft/xml)[ RSS](/packages/xarenisoft-xml/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (1)Versions (14)Used By (0)

Deserializer Xml to Php classes
===============================

[](#deserializer-xml-to-php-classes)

[![Build Status](https://camo.githubusercontent.com/7d9356365650ef385759fb26395c4badccda8ffc46cf60728ca4b025266632ad/68747470733a2f2f7472617669732d63692e6f72672f44616e4e595350442f5472616e73666f726d6174696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/DanNYSPD/Transformation)

Xarenisoft XmlModel is a simple class that you can extend to deserialize and XML Tag and its attributes to a Php Class.

```
class Person extends XmlModel{
    public $attributes=['name','age'];
    public $name; //in this property the value of name attribute will be stored if it's found when you call parseAttributes method

    public $age;//another attribute

    //you can also define a children array to indicate that Person has an Addres Child or children (internally a getElementsByTag is use)
    public $children=[
        'Address'=>Address::class # with this , we indicate that we are gonna take only the first element, if we have a set of elements we can use * after the propertyName
        'Friends*'=>Friend::class
    ]
    public $Address;
    /***
     *
     * @var Friend[]
     */
    public $Friends;

}
class Address extends XmlModel{
    //if we not set the attributes array by default all the class properties will be taken as attributes and the names of the properties will be used as the attribute name.
    public $street;
}
class Friend {
    public $name;
}

#some code before to get the node:
$person= new Person($node);
$person->parseAttributes();
$person->parseChildren();
#now the object person has the attributes (if they are correctly defined in the node) and the Friends array populated with the Objects.
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance41

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

Recently: every ~457 days

Total

12

Last Release

486d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c88bb9614ad980d664e393284ce1b43c8ba4c65554e003c7eb94091778c9bb7?d=identicon)[NYSPD](/maintainers/NYSPD)

---

Top Contributors

[![DanNYSPD](https://avatars.githubusercontent.com/u/21212423?v=4)](https://github.com/DanNYSPD "DanNYSPD (24 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[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)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

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

PHPackages © 2026

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