xp-framework/xp-framework — pull request #166 by kiesel (2012-05-24 16:13:46+00:00)
Title: Introduce accessors for public members of xml classes

# Abstract
```xml.Tree``` and ```xml.Node``` build the basis for the XML support of the XP Framework; the API does not enforce or encourage the use of proper setters to modify the XML representation. To change this, this pull requests adds getters, setters and modifiers for these classes and changes client classes accordingly.

# Details
The gory details:

## Changes to ```xml.Tree```
A tree has a root member, which is a node; it did already have a setter (```withRoot()```), but no getter.
* ```public static xml.Node root()``` will be added.

## Changes to ```xml.Node```
The node does have public members ```$name```, ```$content```, ```$attribute``` and ```$children```. Until now, most of these were modified directly. Now, usage of setters or modifiers is encouraged.
* ```public getAttributes()``` will be added
* ```public void setAttributes([] attrs)``` will be added
* ```setAttribute()```, ```getAttribute()``` already existed.
* ```public xml.Node[] getNodeChildren()``` will be added.
* ```public bool hasNodeChildren()``` will be added.
* ```public void clearNodeChildren()``` will be added.
* ```public xml.Node nodeAt(int $pos)``` will be added.

While even more conveniance setters could be thought of, I wanted to focus on the minimum necessary - even if it can lead to suboptimal usage "from the outside".

### Naming of accessors to ```$children``` member.
I chose the "Node" addix, eg. ```getNodeChildren()``` in order to keep the method name ```getChildren()``` available for future use.

## Additional changes
The pull requests also changes all client code within the XP Framework.