function data=mphgetpair(node,arg)
% data=mphgetpair(node)
%
% data=mphgetpair(model.pair('p1'))

data.pairname = char(node.pairName);
data.type = char(node.type);
data.source = mphgetselections(node.source);
data.destination = mphgetselections(node.destination);

if nargin==2
    dat.pairname = data.pairname;
    dat.type = data.type;
    fn = fieldnames(data.source);
    for i=1:length(fn)
        key = ['source_' fn{i}];
        dat.(key) = data.source.(fn{i});
    end
    fn = fieldnames(data.destination);
    for i=1:length(fn)
        key = ['destination_' fn{i}];
        dat.(key) = data.destination.(fn{i});
    end
    data = dat;
end
% Copyright 2010-2011 COMSOL
