@classmethod
def from_xml(cls, node):
    """
        Construct an Instance from a ``<instance>`` node in EAGLE's XML format.
        """
    part = node.attrib['part']
    gate = node.attrib['gate']
    x = float(node.attrib['x'])
    y = float(node.attrib['y'])
    smashed = node.attrib.get('smashed') == 'yes'
    rot = node.attrib.get('rot', 'R0')
    if rot.startswith('M'):
        mirrored = True
        rotate = int(rot[2:])
    else:
        mirrored = False
        rotate = int(rot[1:])
    return cls(part=part, gate=gate, pos=(x, y), smashed=smashed, mirrored=
        mirrored, rotate=rotate)
