PHPackages                             doctrine/oxm - 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. doctrine/oxm

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

doctrine/oxm
============

Object-XML-Mapper for PHP

2.0.0(14y ago)8822220LGPLPHPPHP &gt;=5.3.2

Since Jan 22Pushed 14y ago7 watchersCompare

[ Source](https://github.com/doctrine/oxm)[ Packagist](https://packagist.org/packages/doctrine/oxm)[ Docs](http://www.doctrine-project.org)[ RSS](/packages/doctrine-oxm/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (3)Used By (0)

Doctrine 2 OXM
==============

[](#doctrine-2-oxm)

Doctrine OXM is a PHP 5.3 project for PHP object to XML mapping that provides support for persisting the XML to a file system via common Doctrine techniques.

Note: This project is still in it's infancy and should not be used for any production related code. Its API is still quite unstable and not all features are yet implemented. Any help in advancing the project forward would be welcome. Let the forking begin!

XmlEntityManager
----------------

[](#xmlentitymanager)

Based on the EntityManager of the Doctrine 2 ORM project. Objects mapped as an @XmlRootEntity may be managed by the XmlEntityManager. As these objects are persisted, they are saved in XML format to the file system under a user configured directory and naming scheme.

```
$user = new User();
$user->setId(1);
$user->setName("Malcolm Reynolds");
$user->setOccupation("Space Cowboy");

$em->persist($user);
$em->flush();            // saves marshalled user object as XML to the file system.

```

The XmlEntityManager also allows access to repository type objects for loading entities back again.

```
$user = $em->getRepository("User")->findById(1);

```

Xml Marshallers
---------------

[](#xml-marshallers)

OXM also provides first class support for the Marshalling and Unmarshalling of PHP Objects to XML and vice-versa based on ideas within the Java Castor XML mapping project. Class metadata for mapped class may be configured via @Annotations, XML, Yaml, or even PHP itself. Marshallers will uses this class metadata to convert your defined objects to XML, as well as reading in XML and converting them to objects.

The behavior of the marshalling and unmarshalling process is completely configurable by the defined class metadata. You can specify the exact xml names for each element, and how they map to the fields of your class. XML attributes, elements, and "text" nodes are all supported, as well as collections.

Marshallers are utilized by the XmlEntityManager internally, but are also provided to be used as first class citizens within your code for whatever you need. This makes working with XML in your application so much easier because you don't really have to think about it anymore!

Example use case:

```
$xml = $this->getRequest()->getParam('posted_xml');

$order = $marshaller->unmarshalFromString($xml);
$this->view->message = "Order recieved:  " . $order->getId();

$update = new UpdateNotification("Order " . $order->getId() . " was received by the application");
$xml = $marshaller->marshalToString($update);

$this->sendToExternalService($xml);

```

Run tests
---------

[](#run-tests)

[Install PHPUnit (&gt;= 3.5)](http://www.phpunit.de/manual/3.6/en/installation.html)

Copy the phpunit.xml

```
cp ./phpunit.xml.dist ./phpunit.xml

```

Run the tests

```
phpunit ./tests

```

### API DOCUMENTATION - todo

[](#api-documentation---todo)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 67.8% 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 ~3 days

Total

2

Last Release

5221d ago

### Community

Maintainers

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

---

Top Contributors

[![richardfullmer](https://avatars.githubusercontent.com/u/384602?v=4)](https://github.com/richardfullmer "richardfullmer (80 commits)")[![igorgolovanov](https://avatars.githubusercontent.com/u/363810?v=4)](https://github.com/igorgolovanov "igorgolovanov (23 commits)")[![GromNaN](https://avatars.githubusercontent.com/u/400034?v=4)](https://github.com/GromNaN "GromNaN (9 commits)")[![fightmaster](https://avatars.githubusercontent.com/u/648770?v=4)](https://github.com/fightmaster "fightmaster (3 commits)")[![jakzal](https://avatars.githubusercontent.com/u/190447?v=4)](https://github.com/jakzal "jakzal (2 commits)")[![beberlei](https://avatars.githubusercontent.com/u/26936?v=4)](https://github.com/beberlei "beberlei (1 commits)")

---

Tags

xmloxm

### Embed Badge

![Health badge](/badges/doctrine-oxm/health.svg)

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

###  Alternatives

[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[jms/serializer

Library for (de-)serializing data of any complexity; supports XML, and JSON.

2.3k135.8M851](/packages/jms-serializer)[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)[presta/sitemap-bundle

A Symfony bundle that provides tools to build your application sitemap.

3929.4M28](/packages/presta-sitemap-bundle)[sabre/xml

sabre/xml is an XML library that you may not hate.

52832.2M131](/packages/sabre-xml)

PHPackages © 2026

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