PHPackages                             sanusart/sxml - 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. sanusart/sxml

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

sanusart/sxml
=============

Simplest, basic XML document creation

09PHP

Since Oct 19Pushed 11y ago1 watchersCompare

[ Source](https://github.com/sanusart/sXml)[ Packagist](https://packagist.org/packages/sanusart/sxml)[ RSS](/packages/sanusart-sxml/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

sXml - Simplest, basic XML document creation
============================================

[](#sxml---simplest-basic-xml-document-creation)

---

This class will assist in very basic XML document creation.

Autoload (with composer)
------------------------

[](#autoload-with-composer)

Add `"sanusart/sxml": "dev-master"` to require array in `composer.json`

Use as:

```

```

Methods
-------

[](#methods)

### Constructor()

[](#constructor)

If `$safe` is set to true - values of XML nodes will be enclosed inside CDATA

```
Constructor __construct
sXml __construct ([bool $safe = false])

```

### doctype()

[](#doctype)

*access: public*

Ommiting method attributes for `$version` and/or `$encoding` will use default values.

```
void doctype ([string $version = '1.0'], [string $encoding = 'utf=8'])
string $version (optional)
string $encoding (optional)

```

### open()

[](#open)

*access: public*

```
void open ([string $tag], [array $attr = array()])
string $tag
array $attr (optional)

```

### close()

[](#close)

*access: public*

```
void close ([string $tag])
string $tag

```

### node()

[](#node)

*access: public*

If `$value` is set - regular node with closing tag will be created e.g. ``. To create a self closed tag `` set `$value` to `null`.

```
void node ([string $tag], [mixed $value], [array $attr = array()])
string $tag
mixed $value | null
array $attr (optional)

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2939db3c9a1f5a494f3374c5857416de95504bf9790ff78b3611de7f2d5cb3d0?d=identicon)[sanusart](/maintainers/sanusart)

---

Top Contributors

[![sanusart](https://avatars.githubusercontent.com/u/267718?v=4)](https://github.com/sanusart "sanusart (13 commits)")

### Embed Badge

![Health badge](/badges/sanusart-sxml/health.svg)

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

###  Alternatives

[tobion/retry

A generic library to retry an operation in case of an error. You can configure the behavior like the exceptions to retry on.

16396.8k](/packages/tobion-retry)[franzose/laravel-smpp

SMS sending via SMPP protocol for Laravel framework.

3941.6k1](/packages/franzose-laravel-smpp)[cammac/carbony

convert from/to Hijri and Gregorian

2443.0k](/packages/cammac-carbony)[steevanb/symfony-container-introspection

Get all Symfony Container informations you need: registered services, instanciated services etc

1034.5k](/packages/steevanb-symfony-container-introspection)

PHPackages © 2026

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