adjusted __init__ to take an xml object