added registration functionality; fixed some hardcoding of XML attributes