I'm a little cautious of putting too much initial XML here if it's not going to match the majority of uses.  I think it's okay to leave out the sections you have properties/accessors methods defined for.  Also, all the XML will be parsed before it's written out, so it's okay if white-space is messed up.  Maybe all you need here is:

    """
    <device>
    <parent>computer</parent>
    <capability type='pci'>
    </capability>
    </device>
    """