PHPackages                             fawno/simple-xml-extended - 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. fawno/simple-xml-extended

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

fawno/simple-xml-extended
=========================

SimpleXMLElement Extended class

1.1.2(6y ago)013.8k↓72.2%MITPHPPHP &gt;=7.0.0

Since Dec 15Pushed 1y ago2 watchersCompare

[ Source](https://github.com/fawno/SimpleXMLExtended)[ Packagist](https://packagist.org/packages/fawno/simple-xml-extended)[ RSS](/packages/fawno-simple-xml-extended/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)DependenciesVersions (6)Used By (0)

SimpleXMLExtended
=================

[](#simplexmlextended)

[![GitHub license](https://camo.githubusercontent.com/b81cd77144e17c2871936de32d7ee34b27254edefa59d1dc77719f6064796e26/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6661776e6f2f53696d706c65584d4c457874656e646564)](https://github.com/fawno/SimpleXMLExtended/blob/master/LICENSE)[![GitHub release](https://camo.githubusercontent.com/0192553afd975001dcd8f20769c4a4db3ef6c459aa7f731b9125b5529eecf363/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6661776e6f2f53696d706c65584d4c457874656e646564)](https://github.com/fawno/SimpleXMLExtended/releases)[![Packagist](https://camo.githubusercontent.com/524790e0a3298b27ccd9f2fb239cb29999631075bbdd97a52b582eb782935e6b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6661776e6f2f73696d706c652d786d6c2d657874656e646564)](https://packagist.org/packages/fawno/simple-xml-extended)[![Packagist Downloads](https://camo.githubusercontent.com/dcab2aab4cad5f8d3bd99bd7b501daf5174fcd8990fa193a5f1f163fd26bab87/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6661776e6f2f73696d706c652d786d6c2d657874656e646564)](https://packagist.org/packages/fawno/simple-xml-extended/stats)[![GitHub issues](https://camo.githubusercontent.com/7078f6cdac9a355c9f492e217dd4429cd1afffbc829227ce3e6dadb8b0ee2a9f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6661776e6f2f53696d706c65584d4c457874656e646564)](https://github.com/fawno/simple-xml-extended/issues)[![GitHub forks](https://camo.githubusercontent.com/c7c128ce26df2af79cfd26c3e4c096f79087221c5c128e34b2b170bbd14730a7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6661776e6f2f53696d706c65584d4c457874656e646564)](https://github.com/fawno/simple-xml-extended/network)[![GitHub stars](https://camo.githubusercontent.com/688d955f5a20aed1c426b2976aecc253eec712ab3467b8e3430d5488a17c5189/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6661776e6f2f53696d706c65584d4c457874656e646564)](https://github.com/fawno/simple-xml-extended/stargazers)[![PHP](https://camo.githubusercontent.com/c678685ab7cc41c93333b719b9255538f172b2c9ad9c1dc03e26feb603ef4deb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6661776e6f2f73696d706c652d786d6c2d657874656e646564)](https://php.net)

SimpleXMLElement Extended class SimpleXMLExtended add a new method for create CData nodes. Also added a new method for output e nice format XML.

Requirements
------------

[](#requirements)

- libxml PHP extension (enabled by default).
- SimpleXML PHP extension (enabled by default).
- DOM PHP extension (enabled by default).

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

[](#installation)

You can install this plugin into your application using [composer](https://getcomposer.org):

```
  composer require fawno/simple-xml-extended

```

or, clone/download this repo, and include src/SimpleXMLExtended.php in your project.

Usage
-----

[](#usage)

```
  use Fawno\SimpleXMLExtended\SimpleXMLExtended;

  // Get a SimpleXMLExtended object from a DOM node
  $xml = simplexml_import_dom($dom, SimpleXMLExtended::class);

  // Interprets an XML file into an SimpleXMLExtended object
  $xml = simplexml_load_file($xml_file, SimpleXMLExtended::class);

  // Interprets a string of XML into an SimpleXMLExtended object
  $xml = simplexml_load_string($xml_string, SimpleXMLExtended::class);

  // Creates a new SimpleXMLExtended object
  $xml = new SimpleXMLExtended($xml_string);

  // Adds a child element to the XML node as cdata
  $xml->addChildCData('node_cdata', 'data as cdata');

  // Return a well-formed and nice formated XML string based on SimpleXMLExtended element
  $xml->formatXML()
```

Example
-------

[](#example)

```
  require 'src/SimpleXMLExtended.php';

  use Fawno\SimpleXMLExtended\SimpleXMLExtended;

  $root = new SimpleXMLExtended('');

  $root->addChildCData('node_cdata', 'data as cdata');

  print_r($root->asXML());
  /*
    Output:

  */

  print_r($root->formatXML());
  /*
    Output:

  */
```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

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

Total

4

Last Release

2326d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.6.0

1.1.0PHP &gt;=7.0.0

### Community

Maintainers

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

---

Top Contributors

[![alphp](https://avatars.githubusercontent.com/u/8992091?v=4)](https://github.com/alphp "alphp (30 commits)")

---

Tags

phpsimplexmlelementxml

### Embed Badge

![Health badge](/badges/fawno-simple-xml-extended/health.svg)

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

###  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)
