A.x 2-xy=x(x-y),这是提取公因式法因式分解,故此选项错误;
B.x 2+xy=x(x+y),这是提取公因式法因式分解,故此选项错误;
C.x 2+xy+y 2无法因式分解,故此选项错误;
D.-x 2+2xy-y 2=-(x 2-2xy+y 2)=-(x-y) 2这是公式法因式分解,故此选项正确.
故选:D.
A.x 2-xy=x(x-y),这是提取公因式法因式分解,故此选项错误;
B.x 2+xy=x(x+y),这是提取公因式法因式分解,故此选项错误;
C.x 2+xy+y 2无法因式分解,故此选项错误;
D.-x 2+2xy-y 2=-(x 2-2xy+y 2)=-(x-y) 2这是公式法因式分解,故此选项正确.
故选:D.