class elementCreator {
public $element;
public static function createElemenet(DOMDocument $dom, $tag, $attributes = null) {
$element = $DOM->createElement($tag);
if ($attributes) {
foreach ($attributes as $attribute => $value) {
$element->setAttribute($attribute, $value);
}
}
$this->element = $element;
return $this;
}
public static function setValue($value) {
$this->element->setAttribute('value', $value);
return $this->element;
}
}