function fromXML($xmlElement)
    {
        if (isset($xmlElement->id)) $this->id = $xmlElement->id;

        if (isset($xmlElement->fields)) {
            $this->fields = array();
            foreach ($xmlElement->fields->children() as $field) {
                $this->fields[trim($field->name)] = (string)$field->value; // The trim is required to make a safer string from the object
            }
        }
    }