static protected function buildRecursive( DOMDocument $document, DOMElement $root, XML_DOM_Node $tree, $encoding )
	{
		foreach( $tree->getAttributes() as $key => $value )
		{
			$root->setAttribute( $key, $value );
		}
		if( $tree->hasChildren() )
		{
			$children = $tree->getChildren();
			foreach( $children as $child )
			{
				$element = $document->createElement( $child->getNodename() );
				self::buildRecursive( $document, $element, $child, $encoding );
				$element = $root->appendChild( $element );
			}
		}
		else if( $tree->hasContent() )
		{
			$text	= (string) $tree->getContent();
			$text	= $document->createTextNode( $text );
			$text	= $root->appendChild( $text );
		}
	}