def __from_xml(self,data):
ns=get_node_ns(data)<EOL>if ns and ns.getContent()!=VCARD_NS:<EOL><INDENT>raise ValueError("<STR_LIT>" % (VCARD_NS,))<EOL><DEDENT>if data.name!="<STR_LIT>":<EOL><INDENT>raise ValueError("<STR_LIT>" % (data.name,))<EOL><DEDENT>n=data.children<EOL>dns=get_node_ns(data)<EOL>while n:<EOL><INDENT>if n.type!='<STR_LIT>':<EOL><INDENT>n=n.next<EOL>continue<EOL><DEDENT>ns=get_node_ns(n)<EOL>if (ns and dns and ns.getContent()!=dns.getContent()):<EOL><INDENT>n=n.next<EOL>continue<EOL><DEDENT>if not self.components.has_key(n.name):<EOL><INDENT>n=n.next<EOL>continue<EOL><DEDENT>cl,tp=self.components[n.name]<EOL>if tp in ("<STR_LIT>","<STR_LIT>"):<EOL><INDENT>if self.content.has_key(n.name):<EOL><INDENT>raise ValueError("<STR_LIT>" % (n.name,))<EOL><DEDENT>try:<EOL><INDENT>self.content[n.name]=cl(n.name,n)<EOL><DEDENT>except Empty:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>elif tp=="<STR_LIT>":<EOL><INDENT>if not self.content.has_key(n.name):<EOL><INDENT>self.content[n.name]=[]<EOL><DEDENT>try:<EOL><INDENT>self.content[n.name].append(cl(n.name,n))<EOL><DEDENT>except Empty:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>n=n.next<EOL><DEDENT>
Initialize a VCard object from XML node.

        :Parameters:
            - `data`: vcard to parse.
        :Types:
            - `data`: `libxml2.xmlNode`