In any vector in the xy plane has no vertical component so its z component is zero.

for part two

is the vector is parallel to the xy plane it is perpendicular to the z axis

again let <x,y,z> be any vector so we know that

so we get

<x,2x,0> =x<1,2,0>

To make this a unit vector divide each component of the vector by the vectors magnitude!